From 8d82548d44c9104b18a155239800da8985c9d19e Mon Sep 17 00:00:00 2001 From: johanknol Date: Sat, 30 Sep 2000 19:24:13 +0000 Subject: [PATCH] cleaning; moved all extern's from .c to .h files for double check git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@428 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/Makefile | 4 ++-- src/ds390/gen.c | 26 ++++++++++++++------------ src/ds390/ralloc.c | 4 +--- src/ds390/ralloc.h | 3 +++ 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/ds390/Makefile b/src/ds390/Makefile index 41682edd..67002c41 100644 --- a/src/ds390/Makefile +++ b/src/ds390/Makefile @@ -5,8 +5,8 @@ include $(PRJDIR)/Makefile.common OBJ = gen.o ralloc.o main.o LIB = port.a -CFLAGS = -g -Wall -O2 -CFLAGS += -I.. -I. -I../.. +CFLAGS = -g -Wall -Werror -O2 +CFLAGS += -I.. -I. all: $(LIB) diff --git a/src/ds390/gen.c b/src/ds390/gen.c index df3f5067..31f57e0f 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -32,7 +32,10 @@ #include #include #include -#include "SDCCglobl.h" + +#include +#include "ralloc.h" +#include "gen.h" #ifdef HAVE_SYS_ISA_DEFS_H #include @@ -47,13 +50,11 @@ #endif #endif -#include "common.h" -#include "SDCCpeeph.h" -#include "ralloc.h" -#include "gen.h" - char *aopLiteral (value *val, int offset); +#if 0 +//REMOVE ME!!! extern int allocInfo; +#endif /* this is the down and dirty file with all kinds of kludgy & hacky stuff. This is what it is all about @@ -82,10 +83,8 @@ static struct { set *sendSet; } _G; -extern int ds390_ptrRegReq ; -extern int ds390_nRegs; -extern FILE *codeOutFile; static void saverbank (int, iCode *,bool); + #define RESULTONSTACK(x) \ (IC_RESULT(x) && IC_RESULT(x)->aop && \ IC_RESULT(x)->aop->type == AOP_STK ) @@ -8349,7 +8348,7 @@ static void genReceive (iCode *ic) } /*-----------------------------------------------------------------*/ -/* gen390Code - generate code for 8051 based controllers */ +/* gen390Code - generate code for Dallas 390 based controllers */ /*-----------------------------------------------------------------*/ void gen390Code (iCode *lic) { @@ -8358,12 +8357,15 @@ void gen390Code (iCode *lic) lineHead = lineCurr = NULL; +#if 0 + //REMOVE ME!!! /* print the allocation information */ if (allocInfo) printAllocInfo( currFunc, codeOutFile); +#endif /* if debug information required */ -/* if (options.debug && currFunc) { */ - if (currFunc) { + if (options.debug && currFunc) { + //jwk if (currFunc) { cdbSymbol(currFunc,cdbFile,FALSE,TRUE); _G.debugLine = 1; if (IS_STATIC(currFunc->etype)) diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index ecec03ea..7555de4e 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -36,8 +36,6 @@ /* since the pack the registers depending strictly on the MCU */ /*-----------------------------------------------------------------*/ -extern void gen390Code(iCode *); - /* Global data */ static struct { bitVect *spiltSet; @@ -2100,7 +2098,7 @@ static void packRegisters (eBBlock *ebp) bitVectnBitsOn(OP_DEFS(IC_RESULT(ic))) == 1 && IS_OP_LITERAL(IC_RIGHT(ic))) ) { - int i = operandLitValue(IC_RIGHT(ic)); + //int i = operandLitValue(IC_RIGHT(ic)); OP_SYMBOL(IC_RESULT(ic))->remat = 1; OP_SYMBOL(IC_RESULT(ic))->rematiCode = ic; OP_SYMBOL(IC_RESULT(ic))->usl.spillLoc = NULL; diff --git a/src/ds390/ralloc.h b/src/ds390/ralloc.h index 6b3a754d..dec059a6 100644 --- a/src/ds390/ralloc.h +++ b/src/ds390/ralloc.h @@ -54,4 +54,7 @@ extern regs regs390[]; regs *ds390_regWithIdx (int); +extern int ds390_ptrRegReq; +extern int ds390_nRegs; + #endif -- 2.47.2