]> git.gag.com Git - fw/sdcc/commitdiff
* src/SDCCsymt.c (processFuncArgs): fixed superflous allocation noted
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 7 Jan 2004 07:28:00 +0000 (07:28 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 7 Jan 2004 07:28:00 +0000 (07:28 +0000)
in bug #860505
* src/SDCCmem.c (printAllocInfoSeg, printAllocInfo): minor changes to
how the function variable allocation summary is displayed; also
include information about variables allocated to the overlay
segment

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3092 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmem.c
src/SDCCsymt.c

index 8f94ce6e777801986fa9287393e06aa6c66b6760..545a081c983661e8bb2c5fcf1fcb468ce4ab9261 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-01-07 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/SDCCsymt.c (processFuncArgs): fixed superflous allocation noted
+       in bug #860505
+       * src/SDCCmem.c (printAllocInfoSeg, printAllocInfo): minor changes to
+       how the function variable allocation summary is displayed; also
+       include information about variables allocated to the overlay
+       segment
+
 2004-01-06  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
 
        * as/mcs51/lkmain.c: Help about -Y option
index 5fe82651fe47e1de45281948dfc7140f71fca936..ba185d241e3da2d5a2e5e95dcc43c705040ada54 100644 (file)
@@ -976,7 +976,7 @@ printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
     return;
   if (!map->syms)
     return;
-
+  
   for (sym = setFirstItem (map->syms); sym;
        sym = setNextItem (map->syms))
     {
@@ -985,7 +985,8 @@ printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
        continue;
       if (sym->localof != func)
        continue;
-      fprintf (of, ";%-25s Allocated to ", sym->name);
+      
+      fprintf (of, ";%-25s Allocated ", sym->name);
 
       /* if assigned to registers */
       if (!sym->allocreq && sym->reqv)
@@ -993,7 +994,7 @@ printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
          int i;
 
          sym = OP_SYMBOL (sym->reqv);
-         fprintf (of, "registers ");
+         fprintf (of, "to registers ");
          for (i = 0; i < 4 && sym->regs[i]; i++)
            fprintf (of, "%s ", port->getRegName (sym->regs[i]));
          fprintf (of, "\n");
@@ -1003,12 +1004,12 @@ printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
       /* if on stack */
       if (sym->onStack)
        {
-         fprintf (of, "stack - offset %d\n", sym->stack);
+         fprintf (of, "to stack - offset %d\n", sym->stack);
          continue;
        }
 
       /* otherwise give rname */
-      fprintf (of, "in memory with name '%s'\n", sym->rname);
+      fprintf (of, "with name '%s'\n", sym->rname);
     }
 }
 
@@ -1090,7 +1091,7 @@ printAllocInfo (symbol * func, FILE * of)
     
   if (!of)
     of = stdout;
-    
+
   /* must be called after register allocation is complete */
   fprintf (of, ";------------------------------------------------------------\n");
   fprintf (of, ";Allocation info for local variables in function '%s'\n", func->name);
@@ -1104,5 +1105,20 @@ printAllocInfo (symbol * func, FILE * of)
   printAllocInfoSeg (idata, func, of);
   printAllocInfoSeg (sfr, func, of);
   printAllocInfoSeg (sfrbit, func, of);
+  
+  {
+    set *ovrset;
+    set *tempOverlaySyms = overlay->syms;
+    
+    /* search the set of overlay sets for local variables/parameters */
+    for (ovrset = setFirstItem (ovrSetSets); ovrset;
+         ovrset = setNextItem (ovrSetSets))
+      {
+        overlay->syms = ovrset;
+        printAllocInfoSeg (overlay, func, of);
+      }
+    overlay->syms = tempOverlaySyms;
+  }
+  
   fprintf (of, ";------------------------------------------------------------\n");
 }
index eafcb45d86d75b468225e3683a16e53cc991f4a3..4b4e00c415d2b9b4fe3e0205de41d813fb1c5985 100644 (file)
@@ -2227,10 +2227,13 @@ processFuncArgs (symbol * func)
          val->sym->etype = getSpec (val->sym->type);
          val->sym->_isparm = 1;
          strncpyz (val->sym->rname, val->name, sizeof(val->sym->rname));
+         #if 0
+         /* ?? static functions shouldn't imply static parameters - EEP */
          if (IS_SPEC(func->etype)) {
            SPEC_STAT (val->etype) = SPEC_STAT (val->sym->etype) =
              SPEC_STAT (func->etype);
          }
+         #endif
          addSymChain (val->sym);
 
        }
@@ -2242,10 +2245,14 @@ processFuncArgs (symbol * func)
          val->sym->_isparm = 1;
          SPEC_OCLS (val->etype) = SPEC_OCLS (val->sym->etype) =
            (options.model != MODEL_SMALL ? xdata : data);
+         
+         #if 0
+         /* ?? static functions shouldn't imply static parameters - EEP */
          if (IS_SPEC(func->etype)) {
            SPEC_STAT (val->etype) = SPEC_STAT (val->sym->etype) =
              SPEC_STAT (func->etype);
          }
+         #endif
        }
       if (!isinSet(operKeyReset, val->sym)) {
        addSet (&operKeyReset, val->sym);