X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCmem.c;h=ba185d241e3da2d5a2e5e95dcc43c705040ada54;hb=22ac74a468a03e9989dc8b6365f8a49530e45a95;hp=6c5f0d87949cab378694c9c3b454d2d3894f05f4;hpb=79d1651a0bec601915aa333071a8e05edb5b1285;p=fw%2Fsdcc diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 6c5f0d87..ba185d24 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -325,9 +325,9 @@ allocGlobal (symbol * sym) SPEC_OCLS (sym->etype) = code; /* if this is an interrupt service routine then put it in the interrupt service array */ - if (FUNC_ISISR (sym->type) && !options.noiv) + if (FUNC_ISISR (sym->type) && !options.noiv + && (FUNC_INTNO (sym->type) != INTNO_UNSPEC)) { - if (interrupts[FUNC_INTNO (sym->type)]) werror (E_INT_DEFINED, FUNC_INTNO (sym->type), @@ -563,8 +563,9 @@ deallocParms (value * val) if (!lval->sym->isref) { lval->sym->allocreq = 0; - werror (W_NO_REFERENCE, currFunc->name, - "function argument", lval->sym->name); + werror (W_NO_REFERENCE, + currFunc ? currFunc->name : "(unknown)", + "function argument", lval->sym->name); } /* move the rname if any to the name for both val & sym */ @@ -741,7 +742,8 @@ deallocLocal (symbol * csym) } /* if not used give a warning */ if (!sym->isref && !IS_STATIC (sym->etype)) - werror (W_NO_REFERENCE, currFunc->name, + werror (W_NO_REFERENCE, + currFunc ? currFunc->name : "(unknown)", "local variable", sym->name); /* now delete it from the symbol table */ deleteSym (SymbolTab, sym, sym->name); @@ -764,7 +766,7 @@ overlay2data () allocIntoSeg (sym); } - setToNull ((void **) &overlay->syms); + setToNull ((void *) &overlay->syms); } @@ -785,7 +787,7 @@ overlay2Set () addSet (&oset, sym); } - setToNull ((void **) &overlay->syms); + setToNull ((void *) &overlay->syms); addSet (&ovrSetSets, oset); } @@ -974,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)) { @@ -983,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) @@ -991,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"); @@ -1001,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); } } @@ -1088,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); @@ -1102,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"); }