From 9dbf0cbcc2c7048a0b2649a9d06183f61d26e791 Mon Sep 17 00:00:00 2001 From: epetrich Date: Wed, 7 Jan 2004 07:28:00 +0000 Subject: [PATCH] * 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 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3092 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 9 +++++++++ src/SDCCmem.c | 28 ++++++++++++++++++++++------ src/SDCCsymt.c | 7 +++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f94ce6e..545a081c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-01-07 Erik Petrich + + * 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 * as/mcs51/lkmain.c: Help about -Y option diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 5fe82651..ba185d24 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -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"); } diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index eafcb45d..4b4e00c4 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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); -- 2.47.2