From: johanknol Date: Sun, 16 Mar 2003 18:27:05 +0000 (+0000) Subject: cleaned up the mess I left behind X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=4d406d0af5861a351d089724c5f3e6d1ee8f70d4;p=fw%2Fsdcc cleaned up the mess I left behind git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2396 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/as/mcs51/lkmain.c b/as/mcs51/lkmain.c index 86e3357d..8ea5fde7 100644 --- a/as/mcs51/lkmain.c +++ b/as/mcs51/lkmain.c @@ -459,7 +459,6 @@ link_main() sdp.s_area = NULL; sdp.s_areax = NULL; sdp.s_addr = 0; - // jwk lastExtendedAddress = -1; break; case 'M': diff --git a/as/mcs51/lkrloc.c b/as/mcs51/lkrloc.c index 52654d59..baa05649 100644 --- a/as/mcs51/lkrloc.c +++ b/as/mcs51/lkrloc.c @@ -544,12 +544,10 @@ relr() if (extendedAddress != lastExtendedAddress) { -#if 1 // jwk - if (lastExtendedAddress!=-1) { - printf("output extended linear address record 0x%x 0x%x\n", - extendedAddress, lastExtendedAddress); - } -#endif + if (lastExtendedAddress!=-1) { + printf("output extended linear address record 0x%x 0x%x\n", + extendedAddress, lastExtendedAddress); + } if (rflag) { diff --git a/device/examples/ds390/ow390/Makefile b/device/examples/ds390/ow390/Makefile index ab84f0c3..feeb5f95 100755 --- a/device/examples/ds390/ow390/Makefile +++ b/device/examples/ds390/ow390/Makefile @@ -1,5 +1,4 @@ CC = sdcc -#CC = /home/johan/sdcc/bin/sdcc MFLAGS = -mds390 LFLAGS = --xram-loc 0x180080 --code-loc 0x10000 -Wl-r diff --git a/device/examples/xa51/hello.c b/device/examples/xa51/hello.c index db0f05b7..f9e42b5a 100755 --- a/device/examples/xa51/hello.c +++ b/device/examples/xa51/hello.c @@ -14,7 +14,6 @@ xdata at 0x1234 abs; void main(void) { puts ("Hello world.\n\r"); - _asm ;johan _endasm; if (d2==2) { puts ("d2=2"); } else { diff --git a/device/lib/_fsadd.c b/device/lib/_fsadd.c index fa0970ae..5da97f0e 100644 --- a/device/lib/_fsadd.c +++ b/device/lib/_fsadd.c @@ -14,8 +14,6 @@ ** uunet!motown!pipeline!phw */ -/* (c)2000/2001: hacked a little by johan.knol@iduna.nl for sdcc */ - #include union float_long @@ -77,15 +75,13 @@ float __fsadd (float a1, float a2) return (0); /* normalize */ - /* jwk: TODO: changing the next two whiles in nested ifs - seriously breaks it. Why?????????????????? */ while (mant1>= 1 ; diff --git a/device/lib/_mullong.c b/device/lib/_mullong.c index 7afdc5af..61dfaa44 100644 --- a/device/lib/_mullong.c +++ b/device/lib/_mullong.c @@ -555,7 +555,6 @@ _mululong (unsigned long a, unsigned long b) // in future: _mullong t.i.hi = bcast(a)->b.b0 * bcast(b)->b.b2; // A t.i.lo = bcast(a)->b.b0 * bcast(b)->b.b0; // A - _asm ;johan _endasm; t.b.b3 += bcast(a)->b.b3 * bcast(b)->b.b0; // G t.b.b3 += bcast(a)->b.b2 * diff --git a/device/lib/vprintf.c b/device/lib/vprintf.c index bbfb8024..6c277e84 100644 --- a/device/lib/vprintf.c +++ b/device/lib/vprintf.c @@ -78,7 +78,7 @@ static data value_t value; static unsigned char radix; -// jwk: TODO: this makes the whole dammed thing nonreentrent +// this makes the whole dammed thing nonreentrent static int charsOutputted; /****************************************************************************/ @@ -530,7 +530,6 @@ get_conversion_spec: length=0; lsd = 1; - //jwk20000814: do this at least once, e.g.: printf ("%d", (int)0); do { value.byte[4] = 0; calculate_digit(); diff --git a/src/SDCCast.c b/src/SDCCast.c index 0962481a..0024cff3 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1275,7 +1275,7 @@ bool constExprTree (ast *cexpr) { return constExprTree(cexpr->right); } if (cexpr->opval.op==CAST) { - // jwk: cast ignored, maybe we should throw a warning here + // cast ignored, maybe we should throw a warning here? return constExprTree(cexpr->right); } if (cexpr->opval.op=='&') { diff --git a/src/SDCCcflow.c b/src/SDCCcflow.c index 2da48baa..95bce8b0 100644 --- a/src/SDCCcflow.c +++ b/src/SDCCcflow.c @@ -1,9 +1,3 @@ -//#define LIVERANGEHUNT -#ifdef LIVERANGEHUNT - #define LRH(x) x -#else - #define LRH(x) -#endif /*------------------------------------------------------------------------- SDCCcflow.c - source file for control flow analysis @@ -144,7 +138,6 @@ eBBSuccessors (eBBlock ** ebbs, int count) if (ebbs[j]->ech && ebbs[j]->ech->op==IFX && (isSymbolEqual(IC_TRUE(ebbs[j]->ech), ebbs[i]->entryLabel) || isSymbolEqual(IC_FALSE(ebbs[j]->ech), ebbs[i]->entryLabel))) { - LRH(printf ("%s has a conditional exit from %s\n", ebbs[i]->entryLabel->name, ebbs[j]->entryLabel->name)); ebbs[i]->hasConditionalExit=1; } } diff --git a/src/SDCCcse.c b/src/SDCCcse.c index af3d2ce9..cde6f7fd 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -1,9 +1,3 @@ -//#define LIVERANGEHUNT -#ifdef LIVERANGEHUNT - #define LRH(x) x -#else - #define LRH(x) -#endif /*------------------------------------------------------------------------- SDCCcse.c - source file for Common Subexpressions and other utility @@ -118,9 +112,6 @@ replaceAllSymBySym (iCode * ic, operand * from, operand * to, bitVect ** ndpset) { iCode *lic; - LRH(printf ("replaceAllSymBySym: from %s to %s\n", - OP_SYMBOL(from)->name, - IS_SYMOP(to) ? OP_SYMBOL(to)->name) : "!SYM"); for (lic = ic; lic; lic = lic->next) { int siaddr; @@ -384,9 +375,6 @@ DEFSETFUNC (findCheaperOp) } - LRH(printf ("findCheaperOp: %s < %s\n",\ - IS_SYMOP((*opp)) ? OP_SYMBOL((*opp))->name : "!SYM",\ - OP_SYMBOL(cop)->name)); return 1; } @@ -436,8 +424,6 @@ DEFSETFUNC (findPrevIc) if (isiCodeEqual (ic, cdp->diCode) && isOperandEqual (cdp->sym, IC_RESULT (cdp->diCode))) { - LRH(printf ("findPrevIc same: %d %d\n", ic->key, cdp->diCode->key)); - *icp = cdp->diCode; return 1; } @@ -448,8 +434,6 @@ DEFSETFUNC (findPrevIc) isOperandEqual (IC_LEFT (ic), IC_RIGHT (cdp->diCode)) && isOperandEqual (IC_RIGHT (ic), IC_LEFT (cdp->diCode))) { - LRH(printf ("findPrevIc inter: %d %d\n", ic->key, cdp->diCode->key)); - *icp = cdp->diCode; return 1; } diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 4ee00554..2792ef48 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2559,13 +2559,6 @@ geniCodeDerefPtr (operand * op,int lvl) op->isGptr = IS_GENPTR (optype); -#ifdef JWK - /* if the pointer was declared as a constant */ - /* then we cannot allow assignment to the derefed */ - if (IS_PTR_CONST (optype)) - SPEC_CONST (retype) = 1; -#endif - op->isaddr = (IS_PTR (rtype) || IS_STRUCT (rtype) || IS_INT (rtype) || diff --git a/src/SDCCloop.c b/src/SDCCloop.c index dbad1e4c..55021f34 100644 --- a/src/SDCCloop.c +++ b/src/SDCCloop.c @@ -1,9 +1,3 @@ -//#define LIVERANGEHUNT -#ifdef LIVERANGEHUNT - #define LRH(x) x -#else - #define LRH(x) -#endif /*------------------------------------------------------------------------- SDCCloop.c - source file for loop detection & optimizations @@ -159,7 +153,6 @@ loopInsert (set ** regionSet, eBBlock * block) { if (!isinSet (*regionSet, block)) { - LRH(printf ("loopInsert: %s\n", block->entryLabel->name)); addSetHead (regionSet, block); STACK_PUSH (regionStack, block); } @@ -236,7 +229,7 @@ DEFSETFUNC (addToExitsMarkDepth) V_ARG (set **, exits); V_ARG (int, depth); V_ARG (region *, lr); - LRH(printf ("addToExitsMarkDepth: %s %d\n", ebp->entryLabel->name, depth)); + /* mark the loop depth of this block */ //if (!ebp->depth) if (ebp->depthregBlocks, ep->to); -#ifdef LIVERANGEHUNT - // print regBlocks jwk - { - eBBlock *ebp; - region *lp=aloop; - for (ebp=setFirstItem(lp->regBlocks); ebp; ebp=setNextItem(lp->regBlocks)) { - printf ("cl1 %s ", ebp->entryLabel->name); - } - printf (" %d\n", count); - } -#endif loopInsert (&aloop->regBlocks, ep->from); -#ifdef LIVERANGEHUNT - // print regBlocks jwk - { - eBBlock *ebp; - region *lp=aloop; - for (ebp=setFirstItem(lp->regBlocks); ebp; ebp=setNextItem(lp->regBlocks)) { - printf ("cl2 %s ", ebp->entryLabel->name); - } - printf (" %d\n", count); - } -#endif while (!STACK_EMPTY (regionStack)) { @@ -311,36 +281,8 @@ DEFSETFUNC (createLoop) applyToSet (block->predList, insertIntoLoop, &aloop->regBlocks); } -#ifdef LIVERANGEHUNT - // print regBlocks jwk - { - eBBlock *ebp; - region *lp=aloop; - for (ebp=setFirstItem(lp->regBlocks); ebp; ebp=setNextItem(lp->regBlocks)) { - printf ("cl3 %s ", ebp->entryLabel->name); - } - printf (" %d\n", count); - } -#endif - aloop->entry = ep->to; -#ifdef LIVERANGEHUNT - // now also include those blocks that conditionally escape from this loop - for (i=1; ihasConditionalExit) { - for (block=setFirstItem(aloop->regBlocks); - block; - block=setNextItem(aloop->regBlocks)) { - if (isinSet(block->predList, ebbs[i])) { - printf ("%s has a forced exit from %s\n", - ebbs[i]->entryLabel->name, - block->entryLabel->name); - } - } - } - } -#else /* set max & min dfNum for loopRegion */ for ( block = setFirstItem(aloop->regBlocks); block; block = setNextItem(aloop->regBlocks)) { @@ -359,20 +301,6 @@ DEFSETFUNC (createLoop) } } } -#endif - -#ifdef LIVERANGEHUNT - printf ("================\n"); - printf (" loop with entry -- > "); - printEntryLabel (aloop->entry, ap); - printf ("\n"); - printf (" loop body --> "); - applyToSet (aloop->regBlocks, printEntryLabel); - printf ("\n"); - printf (" loop exits --> "); - applyToSet (aloop->exits, printEntryLabel); - printf ("\n"); -#endif /* and if this is a conditional block, the other side of the IFX (if any, that could have a greater dfnum) is too */ @@ -466,9 +394,6 @@ isOperandInvariant (operand * op, region * theLoop, set * lInvars) !IS_OP_VOLATILE (op) && assignmentsToSym (theLoop->regBlocks, op) == 0) opin = 1; - LRH(if (opin && IS_SYMOP(op)) { - printf("isOperandInvariant: %s\n", OP_SYMBOL(op)->name); - }); } else opin++; @@ -550,7 +475,7 @@ loopInvariants (region * theLoop, eBBlock ** ebbs, int count) int lin, rin; cseDef *ivar; - /* jwk: TODO this is only needed if the call is between + /* TODO this is only needed if the call is between here and the definition, but I am too lazy to do that now */ /* if there are function calls in this block */ @@ -1252,7 +1177,6 @@ createLoopRegions (eBBlock ** ebbs, int count) int maxDepth = 0; region *lp; - LRH(printf ("createLoopRegions: %p\n", ebbs)); /* get all the back edges in the graph */ if (!applyToSet (graphEdges, backEdges, &bEdges)) return 0; /* found no loops */ @@ -1260,18 +1184,6 @@ createLoopRegions (eBBlock ** ebbs, int count) /* for each of these back edges get the blocks that */ /* constitute the loops */ applyToSet (bEdges, createLoop, &allRegion, ebbs,count); -#ifdef LIVERANGEHUNT - // print regBlocks - { - eBBlock *ebp; - lp=setFirstItem(allRegion); - printf ("createLoopRegions: "); - for (ebp=setFirstItem(lp->regBlocks); ebp; ebp=setNextItem(lp->regBlocks)) { - printf ("%s ", ebp->entryLabel->name); - } - printf (" %d\n", count); - } -#endif /* now we will create regions from these loops */ /* loops with the same entry points are considered to be the */ diff --git a/src/SDCCmem.c b/src/SDCCmem.c index ca5a3513..54c8d012 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -1,9 +1,3 @@ -//#define LIVERANGEHUNT -#ifdef LIVERANGEHUNT - #define LRH(x) x -#else - #define LRH(x) -#endif /*-----------------------------------------------------------------*/ /* SDCCmem.c - 8051 memory management routines */ /*-----------------------------------------------------------------*/ @@ -852,9 +846,8 @@ allocVariables (symbol * symChain) /* then args processing */ if (funcInChain (csym->type)) { -#if 1 // jwk: TODO should have been done already in addDecl() (oclass????) processFuncArgs (csym); -#endif + /* if register bank specified then update maxRegBank */ if (maxRegBank < FUNC_REGBANK (csym->type)) maxRegBank = FUNC_REGBANK (csym->type); @@ -1025,10 +1018,7 @@ printAllocInfoSeg (memmap * map, symbol * func, FILE * of) if (!sym->allocreq && sym->reqv) { int i; - if (!OP_SYMBOL(sym->reqv)->nRegs) { - LRH(printf ("*** warning: %s -> %s\n", sym->name, \ - OP_SYMBOL(sym->reqv)->name)); - } + sym = OP_SYMBOL (sym->reqv); fprintf (of, "registers "); for (i = 0; i < 4 && sym->regs[i]; i++) diff --git a/src/SDCCsymt.h b/src/SDCCsymt.h index d13e58ed..6511a8ca 100644 --- a/src/SDCCsymt.h +++ b/src/SDCCsymt.h @@ -364,8 +364,6 @@ extern sym_link *validateLink(sym_link *l, #define FUNC_ISOVERLAY(x) (x->funcAttrs.overlay) #define IFFUNC_ISOVERLAY(x) (IS_FUNC(x) && FUNC_ISOVERLAY(x)) - -// jwk: I am not sure about this #define IFFUNC_ISBANKEDCALL(x) (!IFFUNC_NONBANKED(x) && \ (options.model == MODEL_LARGE || \ options.model == MODEL_MEDIUM || \ diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 9fb6cda6..f7c49806 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -3033,7 +3033,7 @@ genFunction (iCode * ic) } } } - // jwk: this needs a closer look + // TODO: this needs a closer look SPEC_ISR_SAVED_BANKS(currFunc->etype) = banksToSave; } } @@ -3256,7 +3256,6 @@ genEndFunction (iCode * ic) * Restore any register banks saved by genFunction * in reverse order. */ - // jwk: this needs a closer look unsigned savedBanks = SPEC_ISR_SAVED_BANKS(currFunc->etype); int ix; diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 98b09584..638ad61b 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -2417,7 +2417,7 @@ genFunction (iCode * ic) } } } - // jwk: this needs a closer look + // TODO: this needs a closer look SPEC_ISR_SAVED_BANKS(currFunc->etype) = banksToSave; } } @@ -2642,7 +2642,6 @@ genEndFunction (iCode * ic) * Restore any register banks saved by genFunction * in reverse order. */ - // jwk: this needs a closer look unsigned savedBanks = SPEC_ISR_SAVED_BANKS(currFunc->etype); int ix; diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 0723d9e9..bf3d162f 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1,9 +1,3 @@ -//#define LIVERANGEHUNT -#ifdef LIVERANGEHUNT - #define LRH(x) x -#else - #define LRH(x) -#endif /*------------------------------------------------------------------------ SDCCralloc.c - source file for register allocation. (8051) specific @@ -577,7 +571,6 @@ spillThis (symbol * sym) if (!(sym->remat || sym->usl.spillLoc)) createStackSpil (sym); - LRH(printf("spillThis: %s\n", sym->name)); /* mark it has spilt & put it in the spilt set */ sym->isspilt = sym->spillA = 1; _G.spiltSet = bitVectSetBit (_G.spiltSet, sym->key); @@ -725,7 +718,6 @@ spilSomething (iCode * ic, eBBlock * ebp, symbol * forSym) /* get something we can spil */ ssym = selectSpil (ic, ebp, forSym); - LRH(printf("spilSomething: spilled %s for %s\n", ssym->name, forSym->name)); /* mark it as spilt */ ssym->isspilt = ssym->spillA = 1; @@ -1877,7 +1869,7 @@ pack: { OP_SYMBOL (IC_RESULT (dic))->liveFrom = dic->seq; } - // jwk: and the otherway around? + // TODO: and the otherway around? /* delete from liverange table also delete from all the points inbetween and the new @@ -1939,7 +1931,6 @@ findAssignToSym (operand * op, iCode * ic) if (!dic) return NULL; /* didn't find any assignment to op */ - LRH(printf ("findAssignToSym: %s\n", OP_SYMBOL(IC_RESULT(dic))->name)); /* we are interested only if defined in far space */ /* or in stack space in case of + & - */ @@ -2127,7 +2118,6 @@ packRegsForOneuse (iCode * ic, operand * op, eBBlock * ebp) bitVectFirstBit (OP_DEFS (op))))) return NULL; - LRH(printf ("packRegsForOneUse: %s\n", OP_SYMBOL(op)->name)); /* if that only usage is a cast */ if (dic->op == CAST) { /* to a bigger type */