cleaned up the mess I left behind
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 16 Mar 2003 18:27:05 +0000 (18:27 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 16 Mar 2003 18:27:05 +0000 (18:27 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2396 4a8a32a2-be11-0410-ad9d-d568d2c75423

17 files changed:
as/mcs51/lkmain.c
as/mcs51/lkrloc.c
device/examples/ds390/ow390/Makefile
device/examples/xa51/hello.c
device/lib/_fsadd.c
device/lib/_mullong.c
device/lib/vprintf.c
src/SDCCast.c
src/SDCCcflow.c
src/SDCCcse.c
src/SDCCicode.c
src/SDCCloop.c
src/SDCCmem.c
src/SDCCsymt.h
src/ds390/gen.c
src/mcs51/gen.c
src/mcs51/ralloc.c

index 86e3357d81febf15eeb3f73192488ed3905eb974..8ea5fde7f25b69ec70309c8b3b909a66cc1301cb 100644 (file)
@@ -459,7 +459,6 @@ link_main()
                sdp.s_area = NULL;
                sdp.s_areax = NULL;
                sdp.s_addr = 0;
-               // jwk lastExtendedAddress = -1;
                break;
 
        case 'M':
index 52654d59f407b6ef69a5ebc444f0c96beda4a14f..baa056496fe455baa649ef505d3340fa5d790c1e 100644 (file)
@@ -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)
                    {
index ab84f0c3acdbc42c2a4fb5618efb6bc1b09214ac..feeb5f95d44fd53a1b377364310e5bc39b679a4b 100755 (executable)
@@ -1,5 +1,4 @@
 CC = sdcc
-#CC = /home/johan/sdcc/bin/sdcc
 
 MFLAGS = -mds390
 LFLAGS = --xram-loc 0x180080 --code-loc 0x10000 -Wl-r
index db0f05b7fec5f5ece1cd6f09ec6fb4ed506ea61d..f9e42b5a481de77e8b904a94a77daed4f52aa7fb 100755 (executable)
@@ -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 {
index fa0970ae45c2abafef3c4a371622c61e8574cb45..5da97f0e947658747b0a08553ee2f9df9aad4b49 100644 (file)
@@ -14,8 +14,6 @@
 ** uunet!motown!pipeline!phw
 */
 
-/* (c)2000/2001: hacked a little by johan.knol@iduna.nl for sdcc */
-
 #include <float.h>
 
 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<HIDDEN) {
     mant1 <<= 1;
     exp1--;
   }
 
+  /* round off */
   while (mant1 & 0xff000000) {
-    // round off
     if (mant1&1)
       mant1 += 2;
     mant1 >>= 1 ;
index 7afdc5afefe572dbd3f7505d76d84652cd15eaff..61dfaa446c18648a7c03a17dd35d3ad9baeddc17 100644 (file)
@@ -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 *
index bbfb8024438cd04388fed0812e55213fd17d05b2..6c277e84af4f2bfa2e425600def93bf1b1f5996e 100644 (file)
@@ -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();
index 0962481a8c8aaf5cc23b165b3ca6c1a1f18e77f7..0024cff3f35408cb2de43418cc6be5cf6a4f5a81 100644 (file)
@@ -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=='&') { 
index 2da48baa65430991aebd56a1ed34b4d16e0d74a4..95bce8b09e3d6e42a3cbedfd8deb57cf127e14bf 100644 (file)
@@ -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;
                    }
                  }
index af3d2ce94a0372abbfc4b8bcac47fcb002eecb51..cde6f7fdffd8e89b52c2412f09ceaa9c7419a155 100644 (file)
@@ -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;
     }
 
index 4ee005545ba7f2bc5a1f51defee057d39e6da3df..2792ef48ee309608fca56056e07328998647937c 100644 (file)
@@ -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) ||
index dbad1e4c90f8ce22a18f64de2632a6d0456fdab2..55021f34798aa1a0d80e920e8a9a29bd86e22f6a 100644 (file)
@@ -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->depth<depth)
@@ -272,36 +265,13 @@ DEFSETFUNC (createLoop)
   eBBlock *block;
   int dfMin = count ,dfMax =0, i;
 
-  LRH(printf("CreateLoop\n"));
   /* make sure regionStack is empty */
   while (!STACK_EMPTY (regionStack))
     STACK_POP (regionStack);
 
   /* add the entryBlock */
   addSet (&aloop->regBlocks, 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; i<count; i++) {
-    if (ebbs[i]->hasConditionalExit) {
-      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 */
index ca5a3513946c71f1dc8b0d23428ba2a9a118503f..54c8d0122bc92c5261b0e041b4f1458aa6082f0e 100644 (file)
@@ -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++)
index d13e58edad648c42c9121a237b43b4d0757f8894..6511a8cab7043eb48c20178b623696d6a5ac5c39 100644 (file)
@@ -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 || \
index 9fb6cda6f9c52f2ab597dc02aed1e51aaead048b..f7c49806e57bc5124f4bd6ba68f07ff8f50377c0 100644 (file)
@@ -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;
          
index 98b095848c76665b5e2f53d21b7ea572de468d53..638ad61b894cb75cc840cdc961b8f3e3cbd4b0e4 100644 (file)
@@ -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;
          
index 0723d9e9e5bb7ea33ac58abd775af7162782e8e9..bf3d162f02809cf0c9259391842376c255433a01 100644 (file)
@@ -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 */