1 /*-----------------------------------------------------------------*/
2 /* SDCCmem.c - 8051 memory management routines */
3 /*-----------------------------------------------------------------*/
8 memmap *xstack = NULL; /* xternal stack data */
9 memmap *istack = NULL; /* internal stack */
10 memmap *code = NULL; /* code segment */
11 memmap *data = NULL; /* internal data upto 128 */
12 memmap *xdata = NULL; /* external data */
13 memmap *idata = NULL; /* internal data upto 256 */
14 memmap *bit = NULL; /* bit addressable space */
15 memmap *statsg = NULL; /* the constant data segment */
16 memmap *sfr = NULL; /* register space */
17 memmap *reg = NULL; /* register space */
18 memmap *sfrbit = NULL; /* sfr bit space */
19 memmap *generic = NULL; /* is a generic pointer */
20 memmap *overlay = NULL; /* overlay segment */
21 memmap *eeprom = NULL; /* eeprom location */
22 memmap *home = NULL; /* Unswitchable code bank */
24 /* this is a set of sets each set containing
25 symbols in a single overlay */
26 set *ovrSetSets = NULL;
29 int fatalError = 0; /* fatal error flag */
31 /*-----------------------------------------------------------------*/
32 /* allocMap - allocates a memory map */
33 /*-----------------------------------------------------------------*/
35 allocMap (char rspace, /* sfr space */
36 char farmap, /* far or near segment */
37 char paged, /* can this segment be paged */
38 char direct, /* directly addressable */
39 char bitaddr, /* bit addressable space */
40 char codemap, /* this is code space */
41 unsigned sloc, /* starting location */
42 const char *name, /* 2 character name */
43 char dbName, /* debug name */
44 int ptrType /* pointer type for this space */
49 if (!(map = Safe_alloc (sizeof (memmap))))
51 werror (E_OUT_OF_MEM, __FILE__, sizeof (memmap));
55 memset (map, ZERO, sizeof (memmap));
61 map->codesp = codemap;
65 map->ptrType = ptrType;
66 if (!(map->oFile = tempfile ()))
68 werror (E_TMPFILE_FAILED);
71 addSetHead (&tmpfileSet, map->oFile);
76 /*-----------------------------------------------------------------*/
77 /* initMem - allocates and initializes all the segments */
78 /*-----------------------------------------------------------------*/
82 /* allocate all the segments */
83 /* xternal stack segment ;
91 POINTER-TYPE - FPOINTER
93 xstack = allocMap (0, 1, 1, 0, 0, 0, options.xstack_loc, XSTACK_NAME, 'A', PPOINTER);
95 /* internal stack segment ;
103 POINTER-TYPE - POINTER
105 istack = allocMap (0, 0, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME, 'B', POINTER);
115 POINTER-TYPE - CPOINTER
117 code = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME, 'C', CPOINTER);
127 POINTER-TYPE - CPOINTER
129 home = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME, 'C', CPOINTER);
131 /* Static segment (code for variables );
139 POINTER-TYPE - CPOINTER
141 statsg = allocMap (0, 1, 0, 0, 0, 1, 0, STATIC_NAME, 'D', CPOINTER);
143 /* Data segment - internal storage segment ;
151 POINTER-TYPE - POINTER
153 data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
155 /* overlay segment - same as internal storage segment ;
163 POINTER-TYPE - POINTER
165 overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
167 /* Xternal Data segment -
175 POINTER-TYPE - FPOINTER
177 xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME, 'F', FPOINTER);
179 /* Inderectly addressed internal data segment
187 POINTER-TYPE - IPOINTER
189 idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc, IDATA_NAME, 'G', IPOINTER);
191 /* Static segment (code for variables );
199 POINTER-TYPE - _NONE_
201 bit = allocMap (0, 0, 0, 1, 1, 0, 0, BIT_NAME, 'H', 0);
203 /* Special function register space :-
211 POINTER-TYPE - _NONE_
213 sfr = allocMap (1, 0, 0, 1, 0, 0, 0, REG_NAME, 'I', 0);
223 POINTER-TYPE - _NONE_
225 reg = allocMap (1, 0, 0, 0, 0, 0, 0, REG_NAME, ' ', 0);
235 POINTER-TYPE - _NONE_
237 sfrbit = allocMap (1, 0, 0, 1, 1, 0, 0, REG_NAME, 'J', 0);
247 POINTER-TYPE - EEPPOINTER
249 eeprom = allocMap (0, 1, 0, 0, 0, 0, 0, REG_NAME, 'K', EEPPOINTER);
251 /* the unknown map */
252 generic = allocMap (1, 0, 0, 1, 1, 0, 0, REG_NAME, ' ', GPOINTER);
256 /*-----------------------------------------------------------------*/
257 /* allocIntoSeg - puts a symbol into a memory segment */
258 /*-----------------------------------------------------------------*/
260 allocIntoSeg (symbol * sym)
262 memmap *segment = SPEC_OCLS (sym->etype);
263 addSet (&segment->syms, sym);
266 /*-----------------------------------------------------------------*/
267 /* allocGlobal - aassigns the output segment to a global var */
268 /*-----------------------------------------------------------------*/
270 allocGlobal (symbol * sym)
273 /* symbol name is internal name */
274 if (!sym->level) /* local statics can come here */
275 sprintf (sym->rname, "%s%s", port->fun_prefix, sym->name);
277 /* add it to the operandKey reset */
278 addSet (&operKeyReset, sym);
280 /* if this is a literal e.g. enumerated type */
281 /* put it in the data segment & do nothing */
282 if (IS_LITERAL (sym->etype))
284 SPEC_OCLS (sym->etype) = data;
288 /* if this is a function then assign code space */
289 if (IS_FUNC (sym->type))
291 SPEC_OCLS (sym->etype) = code;
292 /* if this is an interrupt service routine
293 then put it in the interrupt service array */
294 if (FUNC_ISISR (sym->type))
297 if (interrupts[FUNC_INTNO (sym->type)])
298 werror (E_INT_DEFINED,
299 FUNC_INTNO (sym->type),
300 interrupts[FUNC_INTNO (sym->type)]->name);
302 interrupts[FUNC_INTNO (sym->type)] = sym;
304 /* automagically extend the maximum interrupts */
305 if (FUNC_INTNO (sym->type) >= maxInterrupts)
306 maxInterrupts = FUNC_INTNO (sym->type) + 1;
308 /* if it is not compiler defined */
315 /* if this is a SFR or SBIT */
316 if (SPEC_SCLS (sym->etype) == S_SFR ||
317 SPEC_SCLS (sym->etype) == S_SBIT)
320 /* if both absolute address & initial */
321 /* value specified then error */
322 if (IS_ABSOLUTE (sym->etype) && sym->ival)
324 werror (E_SFR_INIT, sym->name);
328 SPEC_OCLS (sym->etype) =
329 (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit);
335 /* if this is a bit variable and no storage class */
336 if (SPEC_NOUN (sym->etype) == V_BIT
337 && SPEC_SCLS (sym->etype) == S_BIT)
339 SPEC_OCLS (sym->etype) = bit;
344 /* if bit storage class */
345 if (SPEC_SCLS (sym->etype) == S_SBIT)
347 SPEC_OCLS (sym->etype) = bit;
352 /* register storage class ignored changed to FIXED */
353 if (SPEC_SCLS (sym->etype) == S_REGISTER)
354 SPEC_SCLS (sym->etype) = S_FIXED;
356 /* if data specified then */
357 if (SPEC_SCLS (sym->etype) == S_DATA)
359 /* set the output class */
360 SPEC_OCLS (sym->etype) = data;
361 /* generate the symbol */
366 /* if it is fixed, then allocate depending on the */
367 /* current memory model,same for automatics */
368 if (SPEC_SCLS (sym->etype) == S_FIXED ||
369 SPEC_SCLS (sym->etype) == S_AUTO)
371 /* set the output class */
372 SPEC_OCLS (sym->etype) = port->mem.default_globl_map;
373 /* generate the symbol */
378 /* if code change to constant */
379 if (SPEC_SCLS (sym->etype) == S_CODE) {
380 SPEC_OCLS (sym->etype) = statsg;
385 if (SPEC_SCLS (sym->etype) == S_XDATA)
387 SPEC_OCLS (sym->etype) = xdata;
392 if (SPEC_SCLS (sym->etype) == S_IDATA)
394 SPEC_OCLS (sym->etype) = idata;
400 if (SPEC_SCLS (sym->etype) == S_EEPROM)
402 SPEC_OCLS (sym->etype) = eeprom;
410 /*-----------------------------------------------------------------*/
411 /* allocParms - parameters are always passed on stack */
412 /*-----------------------------------------------------------------*/
414 allocParms (value * val)
419 for (lval = val; lval; lval = lval->next, pNum++)
422 /* check the declaration */
423 checkDecl (lval->sym, 0);
425 /* if this a register parm then allocate
426 it as a local variable by adding it
427 to the first block we see in the body */
428 if (IS_REGPARM (lval->etype))
431 /* mark it as my parameter */
432 lval->sym->ismyparm = 1;
433 lval->sym->localof = currFunc;
436 /* if automatic variables r 2b stacked */
437 if (options.stackAuto || IFFUNC_ISREENT (currFunc->type))
441 lval->sym->onStack = 1;
443 /* choose which stack 2 use */
444 /* use xternal stack */
445 if (options.useXstack)
447 /* PENDING: stack direction support */
448 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xstack;
449 SPEC_STAK (lval->etype) = SPEC_STAK (lval->sym->etype) = lval->sym->stack =
450 xstackPtr - getSize (lval->type);
451 xstackPtr -= getSize (lval->type);
454 { /* use internal stack */
455 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = istack;
456 if (port->stack.direction > 0)
458 SPEC_STAK (lval->etype) = SPEC_STAK (lval->sym->etype) = lval->sym->stack =
459 stackPtr - (FUNC_REGBANK (currFunc->type) ? port->stack.bank_overhead : 0) -
460 getSize (lval->type) -
461 (FUNC_ISISR (currFunc->type) ? port->stack.isr_overhead : 0);
462 stackPtr -= getSize (lval->type);
466 /* This looks like the wrong order but it turns out OK... */
467 /* PENDING: isr, bank overhead, ... */
468 SPEC_STAK (lval->etype) = SPEC_STAK (lval->sym->etype) = lval->sym->stack =
470 ((IFFUNC_ISBANKEDCALL (currFunc->type) && !SPEC_STAT(getSpec(currFunc->etype)))? port->stack.banked_overhead : 0) +
471 (FUNC_ISISR (currFunc->type) ? port->stack.isr_overhead : 0) +
473 stackPtr += getSize (lval->type);
476 allocIntoSeg (lval->sym);
479 { /* allocate them in the automatic space */
480 /* generate a unique name */
481 sprintf (lval->sym->rname, "%s%s_PARM_%d", port->fun_prefix, currFunc->name, pNum);
482 strcpy (lval->name, lval->sym->rname);
484 /* if declared in external storage */
485 if (SPEC_SCLS (lval->etype) == S_XDATA)
486 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xdata;
488 /* other wise depending on the memory model
489 note here that we put it into the overlay segment
490 first, we will remove it from the overlay segment
491 after the overlay determination has been done */
492 if (options.model == MODEL_SMALL)
494 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) =
495 (options.noOverlay ? port->mem.default_local_map
500 SPEC_SCLS (lval->etype) = S_XDATA;
501 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xdata;
503 allocIntoSeg (lval->sym);
510 /*-----------------------------------------------------------------*/
511 /* deallocParms - parameters are always passed on stack */
512 /*-----------------------------------------------------------------*/
514 deallocParms (value * val)
518 for (lval = val; lval; lval = lval->next)
521 /* unmark is myparm */
522 lval->sym->ismyparm = 0;
523 /* if on stack then depending on which stack */
525 /* delete it from the symbol table */
526 deleteSym (SymbolTab, lval->sym, lval->sym->name);
528 if (!lval->sym->isref)
530 lval->sym->allocreq = 1;
531 werror (W_NO_REFERENCE, currFunc->name,
532 "function argument", lval->sym->name);
535 /* move the rname if any to the name for both val & sym */
536 /* and leave a copy of it in the symbol table */
537 if (lval->sym->rname[0])
539 char buffer[SDCC_NAME_MAX];
540 strcpy (buffer, lval->sym->rname);
541 lval->sym = copySymbol (lval->sym);
542 strcpy (lval->sym->rname, buffer);
543 strcpy (lval->name, strcpy (lval->sym->name, lval->sym->rname));
544 addSym (SymbolTab, lval->sym, lval->sym->name,
545 lval->sym->level, lval->sym->block, 1);
546 lval->sym->_isparm = 1;
547 addSet (&operKeyReset, lval->sym);
555 /*-----------------------------------------------------------------*/
556 /* allocLocal - allocate local variables */
557 /*-----------------------------------------------------------------*/
559 allocLocal (symbol * sym)
562 /* generate an unique name */
563 sprintf (sym->rname, "%s%s_%s_%d_%d",
565 currFunc->name, sym->name, sym->level, sym->block);
568 sym->localof = currFunc;
570 /* if this is a static variable */
571 if (IS_STATIC (sym->etype))
578 /* if volatile then */
579 if (IS_VOLATILE (sym->etype))
582 /* this is automatic */
584 /* if it to be placed on the stack */
585 if (options.stackAuto || reentrant) {
587 if (options.useXstack) {
588 /* PENDING: stack direction for xstack */
589 SPEC_OCLS (sym->etype) = xstack;
590 SPEC_STAK (sym->etype) = sym->stack = (xstackPtr + 1);
591 xstackPtr += getSize (sym->type);
593 SPEC_OCLS (sym->etype) = istack;
594 if (port->stack.direction > 0) {
595 SPEC_STAK (sym->etype) = sym->stack = (stackPtr + 1);
596 stackPtr += getSize (sym->type);
598 stackPtr -= getSize (sym->type);
599 SPEC_STAK (sym->etype) = sym->stack = stackPtr;
606 /* else depending on the storage class specified */
607 if (SPEC_SCLS (sym->etype) == S_XDATA)
609 SPEC_OCLS (sym->etype) = xdata;
614 if (SPEC_SCLS (sym->etype) == S_CODE && !sym->_isparm) {
615 SPEC_OCLS (sym->etype) = statsg;
620 if (SPEC_SCLS (sym->etype) == S_IDATA)
622 SPEC_OCLS (sym->etype) = idata;
628 /* if this is a function then assign code space */
629 if (IS_FUNC (sym->type))
631 SPEC_OCLS (sym->etype) = code;
635 /* if this is a SFR or SBIT */
636 if (SPEC_SCLS (sym->etype) == S_SFR ||
637 SPEC_SCLS (sym->etype) == S_SBIT)
640 /* if both absolute address & initial */
641 /* value specified then error */
642 if (IS_ABSOLUTE (sym->etype) && sym->ival)
644 werror (E_SFR_INIT, sym->name);
648 SPEC_OCLS (sym->etype) =
649 (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit);
655 /* if this is a bit variable and no storage class */
656 if (SPEC_NOUN (sym->etype) == V_BIT
657 && (SPEC_SCLS (sym->etype) == S_BIT))
659 SPEC_OCLS (sym->etype) = bit;
664 if (SPEC_SCLS (sym->etype) == S_DATA)
666 SPEC_OCLS (sym->etype) = (options.noOverlay ? data : overlay);
671 if (SPEC_SCLS (sym->etype) == S_EEPROM)
673 SPEC_OCLS (sym->etype) = eeprom;
678 /* again note that we have put it into the overlay segment
679 will remove and put into the 'data' segment if required after
680 overlay analysis has been done */
681 if (options.model == MODEL_SMALL) {
682 SPEC_OCLS (sym->etype) =
683 (options.noOverlay ? port->mem.default_local_map
686 SPEC_OCLS (sym->etype) = port->mem.default_local_map;
691 /*-----------------------------------------------------------------*/
692 /* deallocLocal - deallocates the local variables */
693 /*-----------------------------------------------------------------*/
695 deallocLocal (symbol * csym)
699 for (sym = csym; sym; sym = sym->next)
704 /* if it is on the stack */
707 if (options.useXstack)
708 xstackPtr -= getSize (sym->type);
710 stackPtr -= getSize (sym->type);
712 /* if not used give a warning */
713 if (!sym->isref && !IS_STATIC (sym->etype))
714 werror (W_NO_REFERENCE, currFunc->name,
715 "local variable", sym->name);
716 /* now delete it from the symbol table */
717 deleteSym (SymbolTab, sym, sym->name);
721 /*-----------------------------------------------------------------*/
722 /* overlay2data - moves declarations from the overlay seg to data */
723 /*-----------------------------------------------------------------*/
729 for (sym = setFirstItem (overlay->syms); sym;
730 sym = setNextItem (overlay->syms))
733 SPEC_OCLS (sym->etype) = data;
737 setToNull ((void **) &overlay->syms);
741 /*-----------------------------------------------------------------*/
742 /* overlay2Set - will add all symbols from the overlay segment to */
743 /* the set of sets containing the overlable symbols */
744 /*-----------------------------------------------------------------*/
751 for (sym = setFirstItem (overlay->syms); sym;
752 sym = setNextItem (overlay->syms))
758 setToNull ((void **) &overlay->syms);
759 addSet (&ovrSetSets, oset);
763 /*-----------------------------------------------------------------*/
764 /* allocVariables - creates decl & assign storage class for a v */
765 /*-----------------------------------------------------------------*/
767 allocVariables (symbol * symChain)
774 /* go thru the symbol chain */
775 for (sym = symChain; sym; sym = sym->next)
778 /* if this is a typedef then add it */
779 /* to the typedef table */
780 if (IS_TYPEDEF (sym->etype))
782 /* check if the typedef already exists */
783 csym = findSym (TypedefTab, NULL, sym->name);
784 if (csym && csym->level == sym->level)
785 werror (E_DUPLICATE_TYPEDEF, sym->name);
787 addSym (TypedefTab, sym, sym->name, sym->level, sym->block, 0);
788 continue; /* go to the next one */
790 /* make sure it already exist */
791 csym = findSymWithLevel (SymbolTab, sym);
792 if (!csym || (csym && csym->level != sym->level))
795 /* check the declaration */
798 /* if this is a function or a pointer to function */
799 /* then args processing */
800 if (funcInChain (csym->type))
802 #if 1 // jwk: TODO should have been done already in addDecl() (oclass????)
803 processFuncArgs (csym);
805 /* if register bank specified then update maxRegBank */
806 if (maxRegBank < FUNC_REGBANK (csym->type))
807 maxRegBank = FUNC_REGBANK (csym->type);
810 /* if this is a extern variable then change the */
811 /* level to zero temporarily */
812 if (IS_EXTERN (csym->etype) || IS_FUNC (csym->type))
814 saveLevel = csym->level;
818 /* if this is a literal then it is an enumerated */
819 /* type so need not allocate it space for it */
820 if (IS_LITERAL (sym->etype))
823 /* generate the actual declaration */
828 stack += getSize (csym->type);
833 /* restore the level */
834 if (IS_EXTERN (csym->etype) || IS_FUNC (csym->type))
835 csym->level = saveLevel;
841 /*-----------------------------------------------------------------*/
842 /* redoStackOffsets :- will reassign the values for stack offsets */
843 /*-----------------------------------------------------------------*/
845 redoStackOffsets (void)
851 /* after register allocation is complete we know
852 which variables will need to be assigned space
853 on the stack. We will eliminate those variables
854 which do not have the allocReq flag thus reducing
856 for (sym = setFirstItem (istack->syms); sym;
857 sym = setNextItem (istack->syms))
860 int size = getSize (sym->type);
861 /* nothing to do with parameters so continue */
862 if ((sym->_isparm && !IS_REGPARM (sym->etype)))
865 if (IS_AGGREGATE (sym->type))
867 if (port->stack.direction > 0)
869 SPEC_STAK (sym->etype) = sym->stack = (sPtr + 1);
875 SPEC_STAK (sym->etype) = sym->stack = sPtr;
880 /* if allocation not required then subtract
881 size from overall stack size & continue */
884 currFunc->stack -= size;
885 SPEC_STAK (currFunc->etype) -= size;
889 if (port->stack.direction > 0)
891 SPEC_STAK (sym->etype) = sym->stack = (sPtr + 1);
897 SPEC_STAK (sym->etype) = sym->stack = sPtr;
901 /* do the same for the external stack */
903 for (sym = setFirstItem (xstack->syms); sym;
904 sym = setNextItem (xstack->syms))
907 int size = getSize (sym->type);
908 /* nothing to do with parameters so continue */
909 if ((sym->_isparm && !IS_REGPARM (sym->etype)))
912 if (IS_AGGREGATE (sym->type))
914 SPEC_STAK (sym->etype) = sym->stack = (xsPtr + 1);
919 /* if allocation not required then subtract
920 size from overall stack size & continue */
923 currFunc->xstack -= size;
924 SPEC_STAK (currFunc->etype) -= size;
928 SPEC_STAK (sym->etype) = sym->stack = (xsPtr + 1);
932 /* if the debug option is set then output the
933 symbols to the map file */
936 for (sym = setFirstItem (istack->syms); sym;
937 sym = setNextItem (istack->syms))
938 cdbSymbol (sym, cdbFile, FALSE, FALSE);
940 for (sym = setFirstItem (xstack->syms); sym;
941 sym = setNextItem (xstack->syms))
942 cdbSymbol (sym, cdbFile, FALSE, FALSE);
946 /*-----------------------------------------------------------------*/
947 /* printAllocInfoSeg- print the allocation for a given section */
948 /*-----------------------------------------------------------------*/
950 printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
959 for (sym = setFirstItem (map->syms); sym;
960 sym = setNextItem (map->syms))
965 if (sym->localof != func)
967 fprintf (of, ";%-25s Allocated to ", sym->name);
969 /* if assigned to registers */
970 if (!sym->allocreq && sym->reqv)
973 sym = OP_SYMBOL (sym->reqv);
974 fprintf (of, "registers ");
975 for (i = 0; i < 4 && sym->regs[i]; i++)
976 fprintf (of, "%s ", port->getRegName (sym->regs[i]));
984 fprintf (of, "stack - offset %d\n", sym->stack);
988 /* otherwise give rname */
989 fprintf (of, "in memory with name '%s'\n", sym->rname);
993 /*-----------------------------------------------------------------*/
994 /* canOverlayLocals - returns true if the local variables can overlayed */
995 /*-----------------------------------------------------------------*/
997 canOverlayLocals (eBBlock ** ebbs, int count)
1000 /* if staticAuto is in effect or the current function
1001 being compiled is reentrant or the overlay segment
1002 is empty or no overlay option is in effect then */
1003 if (options.noOverlay ||
1004 options.stackAuto ||
1006 (IFFUNC_ISREENT (currFunc->type) ||
1007 FUNC_ISISR (currFunc->type))) ||
1008 elementsInSet (overlay->syms) == 0)
1012 /* otherwise do thru the blocks and see if there
1013 any function calls if found then return false */
1014 for (i = 0; i < count; i++)
1018 for (ic = ebbs[i]->sch; ic; ic = ic->next)
1020 if (ic->op == CALL) {
1021 sym_link *ftype = operandType(IC_LEFT(ic));
1022 /* builtins only can use overlays */
1023 if (!IFFUNC_ISBUILTIN(ftype)) return FALSE;
1024 } else if (ic->op == PCALL) return FALSE;
1028 /* no function calls found return TRUE */
1032 /*-----------------------------------------------------------------*/
1033 /* doOverlays - move the overlay segment to appropriate location */
1034 /*-----------------------------------------------------------------*/
1036 doOverlays (eBBlock ** ebbs, int count)
1038 /* check if the parameters and local variables
1039 of this function can be put in the overlay segment
1040 This check is essentially to see if the function
1041 calls any other functions if yes then we cannot
1043 if (canOverlayLocals (ebbs, count))
1044 /* if we can then put the parameters &
1045 local variables in the overlay set */
1048 /* otherwise put them into data where
1053 /*-----------------------------------------------------------------*/
1054 /* printAllocInfo - prints allocation information for a function */
1055 /*-----------------------------------------------------------------*/
1057 printAllocInfo (symbol * func, FILE * of)
1062 /* must be called after register allocation is complete */
1063 fprintf (of, ";------------------------------------------------------------\n");
1064 fprintf (of, ";Allocation info for local variables in function '%s'\n", func->name);
1065 fprintf (of, ";------------------------------------------------------------\n");
1067 printAllocInfoSeg (xstack, func, of);
1068 printAllocInfoSeg (istack, func, of);
1069 printAllocInfoSeg (code, func, of);
1070 printAllocInfoSeg (data, func, of);
1071 printAllocInfoSeg (xdata, func, of);
1072 printAllocInfoSeg (idata, func, of);
1073 printAllocInfoSeg (sfr, func, of);
1074 printAllocInfoSeg (sfrbit, func, of);