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 *xidata = NULL; /* the initialized xdata */
14 memmap *xinit = NULL; /* the initializers for xidata */
15 memmap *idata = NULL; /* internal data upto 256 */
16 memmap *bit = NULL; /* bit addressable space */
17 memmap *statsg = NULL; /* the constant data segment */
18 memmap *sfr = NULL; /* register space */
19 memmap *reg = NULL; /* register space */
20 memmap *sfrbit = NULL; /* sfr bit space */
21 memmap *generic = NULL; /* is a generic pointer */
22 memmap *overlay = NULL; /* overlay segment */
23 memmap *eeprom = NULL; /* eeprom location */
24 memmap *home = NULL; /* Unswitchable code bank */
26 /* this is a set of sets each set containing
27 symbols in a single overlay */
28 set *ovrSetSets = NULL;
31 int fatalError = 0; /* fatal error flag */
33 /*-----------------------------------------------------------------*/
34 /* allocMap - allocates a memory map */
35 /*-----------------------------------------------------------------*/
37 allocMap (char rspace, /* sfr space */
38 char farmap, /* far or near segment */
39 char paged, /* can this segment be paged */
40 char direct, /* directly addressable */
41 char bitaddr, /* bit addressable space */
42 char codemap, /* this is code space */
43 unsigned sloc, /* starting location */
44 const char *name, /* 2 character name */
45 char dbName, /* debug name */
46 int ptrType /* pointer type for this space */
51 if (!(map = Safe_alloc (sizeof (memmap))))
53 werror (E_OUT_OF_MEM, __FILE__, sizeof (memmap));
57 memset (map, ZERO, sizeof (memmap));
63 map->codesp = codemap;
67 map->ptrType = ptrType;
68 if (!(map->oFile = tempfile ()))
70 werror (E_TMPFILE_FAILED);
73 addSetHead (&tmpfileSet, map->oFile);
78 /*-----------------------------------------------------------------*/
79 /* initMem - allocates and initializes all the segments */
80 /*-----------------------------------------------------------------*/
84 /* allocate all the segments */
85 /* xternal stack segment ;
93 POINTER-TYPE - FPOINTER
95 xstack = allocMap (0, 1, 1, 0, 0, 0, options.xstack_loc, XSTACK_NAME, 'A', PPOINTER);
97 /* internal stack segment ;
105 POINTER-TYPE - POINTER
107 istack = allocMap (0, 0, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME, 'B', POINTER);
117 POINTER-TYPE - CPOINTER
119 code = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME, 'C', CPOINTER);
129 POINTER-TYPE - CPOINTER
131 home = allocMap (0, 1, 0, 0, 0, 1, options.code_loc, CODE_NAME, 'C', CPOINTER);
133 /* Static segment (code for variables );
141 POINTER-TYPE - CPOINTER
143 statsg = allocMap (0, 1, 0, 0, 0, 1, 0, STATIC_NAME, 'D', CPOINTER);
145 /* Data segment - internal storage segment ;
153 POINTER-TYPE - POINTER
155 data = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
157 /* overlay segment - same as internal storage segment ;
165 POINTER-TYPE - POINTER
167 overlay = allocMap (0, 0, 0, 1, 0, 0, options.data_loc, DATA_NAME, 'E', POINTER);
169 /* Xternal Data segment -
177 POINTER-TYPE - FPOINTER
179 xdata = allocMap (0, 1, 0, 0, 0, 0, options.xdata_loc, XDATA_NAME, 'F', FPOINTER);
180 xidata = allocMap (0, 1, 0, 0, 0, 0, 0, XIDATA_NAME, 'F', FPOINTER);
181 xinit = allocMap (0, 1, 0, 0, 0, 1, 0, XINIT_NAME, 'C', CPOINTER);
183 /* Inderectly addressed internal data segment
191 POINTER-TYPE - IPOINTER
193 idata = allocMap (0, 0, 0, 0, 0, 0, options.idata_loc, IDATA_NAME, 'G', IPOINTER);
195 /* Static segment (code for variables );
203 POINTER-TYPE - _NONE_
205 bit = allocMap (0, 0, 0, 1, 1, 0, 0, BIT_NAME, 'H', 0);
207 /* Special function register space :-
215 POINTER-TYPE - _NONE_
217 sfr = allocMap (1, 0, 0, 1, 0, 0, 0, REG_NAME, 'I', 0);
227 POINTER-TYPE - _NONE_
229 reg = allocMap (1, 0, 0, 0, 0, 0, 0, REG_NAME, ' ', 0);
239 POINTER-TYPE - _NONE_
241 sfrbit = allocMap (1, 0, 0, 1, 1, 0, 0, REG_NAME, 'J', 0);
251 POINTER-TYPE - EEPPOINTER
253 eeprom = allocMap (0, 1, 0, 0, 0, 0, 0, REG_NAME, 'K', EEPPOINTER);
255 /* the unknown map */
256 generic = allocMap (1, 0, 0, 1, 1, 0, 0, REG_NAME, ' ', GPOINTER);
260 /*-----------------------------------------------------------------*/
261 /* allocIntoSeg - puts a symbol into a memory segment */
262 /*-----------------------------------------------------------------*/
264 allocIntoSeg (symbol * sym)
266 memmap *segment = SPEC_OCLS (sym->etype);
267 addSet (&segment->syms, sym);
270 /*-----------------------------------------------------------------*/
271 /* allocGlobal - aassigns the output segment to a global var */
272 /*-----------------------------------------------------------------*/
274 allocGlobal (symbol * sym)
277 /* symbol name is internal name */
278 if (!sym->level) /* local statics can come here */
279 sprintf (sym->rname, "%s%s", port->fun_prefix, sym->name);
281 /* add it to the operandKey reset */
282 addSet (&operKeyReset, sym);
284 /* if this is a literal e.g. enumerated type */
285 /* put it in the data segment & do nothing */
286 if (IS_LITERAL (sym->etype))
288 SPEC_OCLS (sym->etype) = data;
292 /* if this is a function then assign code space */
293 if (IS_FUNC (sym->type))
295 SPEC_OCLS (sym->etype) = code;
296 /* if this is an interrupt service routine
297 then put it in the interrupt service array */
298 if (FUNC_ISISR (sym->type))
301 if (interrupts[FUNC_INTNO (sym->type)])
302 werror (E_INT_DEFINED,
303 FUNC_INTNO (sym->type),
304 interrupts[FUNC_INTNO (sym->type)]->name);
306 interrupts[FUNC_INTNO (sym->type)] = sym;
308 /* automagically extend the maximum interrupts */
309 if (FUNC_INTNO (sym->type) >= maxInterrupts)
310 maxInterrupts = FUNC_INTNO (sym->type) + 1;
312 /* if it is not compiler defined */
319 /* if this is a SFR or SBIT */
320 if (SPEC_SCLS (sym->etype) == S_SFR ||
321 SPEC_SCLS (sym->etype) == S_SBIT)
324 /* if both absolute address & initial */
325 /* value specified then error */
326 if (IS_ABSOLUTE (sym->etype) && sym->ival)
328 werror (E_SFR_INIT, sym->name);
332 SPEC_OCLS (sym->etype) =
333 (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit);
339 /* if this is a bit variable and no storage class */
340 if (SPEC_NOUN (sym->etype) == V_BIT
341 && SPEC_SCLS (sym->etype) == S_BIT)
343 SPEC_OCLS (sym->etype) = bit;
348 /* if bit storage class */
349 if (SPEC_SCLS (sym->etype) == S_SBIT)
351 SPEC_OCLS (sym->etype) = bit;
356 /* register storage class ignored changed to FIXED */
357 if (SPEC_SCLS (sym->etype) == S_REGISTER)
358 SPEC_SCLS (sym->etype) = S_FIXED;
360 /* if data specified then */
361 if (SPEC_SCLS (sym->etype) == S_DATA)
363 /* set the output class */
364 SPEC_OCLS (sym->etype) = data;
365 /* generate the symbol */
370 /* if it is fixed, then allocate depending on the */
371 /* current memory model,same for automatics */
372 if (SPEC_SCLS (sym->etype) == S_FIXED ||
373 SPEC_SCLS (sym->etype) == S_AUTO)
375 /* set the output class */
376 SPEC_OCLS (sym->etype) = port->mem.default_globl_map;
377 /* generate the symbol */
382 /* if code change to constant */
383 if (SPEC_SCLS (sym->etype) == S_CODE) {
384 SPEC_OCLS (sym->etype) = statsg;
389 if (SPEC_SCLS (sym->etype) == S_XDATA)
391 SPEC_OCLS (sym->etype) = xdata;
396 if (SPEC_SCLS (sym->etype) == S_IDATA)
398 SPEC_OCLS (sym->etype) = idata;
404 if (SPEC_SCLS (sym->etype) == S_EEPROM)
406 SPEC_OCLS (sym->etype) = eeprom;
414 /*-----------------------------------------------------------------*/
415 /* allocParms - parameters are always passed on stack */
416 /*-----------------------------------------------------------------*/
418 allocParms (value * val)
423 for (lval = val; lval; lval = lval->next, pNum++)
426 /* check the declaration */
427 checkDecl (lval->sym, 0);
429 /* if this a register parm then allocate
430 it as a local variable by adding it
431 to the first block we see in the body */
432 if (IS_REGPARM (lval->etype))
435 /* mark it as my parameter */
436 lval->sym->ismyparm = 1;
437 lval->sym->localof = currFunc;
440 /* if automatic variables r 2b stacked */
441 if (options.stackAuto || IFFUNC_ISREENT (currFunc->type))
445 lval->sym->onStack = 1;
447 /* choose which stack 2 use */
448 /* use xternal stack */
449 if (options.useXstack)
451 /* PENDING: stack direction support */
452 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xstack;
453 SPEC_STAK (lval->etype) = SPEC_STAK (lval->sym->etype) = lval->sym->stack =
454 xstackPtr - getSize (lval->type);
455 xstackPtr -= getSize (lval->type);
458 { /* use internal stack */
459 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = istack;
460 if (port->stack.direction > 0)
462 SPEC_STAK (lval->etype) = SPEC_STAK (lval->sym->etype) = lval->sym->stack =
463 stackPtr - (FUNC_REGBANK (currFunc->type) ? port->stack.bank_overhead : 0) -
464 getSize (lval->type) -
465 (FUNC_ISISR (currFunc->type) ? port->stack.isr_overhead : 0);
466 stackPtr -= getSize (lval->type);
470 /* This looks like the wrong order but it turns out OK... */
471 /* PENDING: isr, bank overhead, ... */
472 SPEC_STAK (lval->etype) = SPEC_STAK (lval->sym->etype) = lval->sym->stack =
474 ((IFFUNC_ISBANKEDCALL (currFunc->type) && !SPEC_STAT(getSpec(currFunc->etype)))? port->stack.banked_overhead : 0) +
475 (FUNC_ISISR (currFunc->type) ? port->stack.isr_overhead : 0) +
477 stackPtr += getSize (lval->type);
480 allocIntoSeg (lval->sym);
483 { /* allocate them in the automatic space */
484 /* generate a unique name */
485 sprintf (lval->sym->rname, "%s%s_PARM_%d", port->fun_prefix, currFunc->name, pNum);
486 strcpy (lval->name, lval->sym->rname);
488 /* if declared in external storage */
489 if (SPEC_SCLS (lval->etype) == S_XDATA)
490 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xdata;
492 /* other wise depending on the memory model
493 note here that we put it into the overlay segment
494 first, we will remove it from the overlay segment
495 after the overlay determination has been done */
496 if (options.model == MODEL_SMALL)
498 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) =
499 (options.noOverlay ? port->mem.default_local_map
504 SPEC_SCLS (lval->etype) = S_XDATA;
505 SPEC_OCLS (lval->etype) = SPEC_OCLS (lval->sym->etype) = xdata;
507 allocIntoSeg (lval->sym);
514 /*-----------------------------------------------------------------*/
515 /* deallocParms - parameters are always passed on stack */
516 /*-----------------------------------------------------------------*/
518 deallocParms (value * val)
522 for (lval = val; lval; lval = lval->next)
525 /* unmark is myparm */
526 lval->sym->ismyparm = 0;
527 /* if on stack then depending on which stack */
529 /* delete it from the symbol table */
530 deleteSym (SymbolTab, lval->sym, lval->sym->name);
532 if (!lval->sym->isref)
534 lval->sym->allocreq = 1;
535 werror (W_NO_REFERENCE, currFunc->name,
536 "function argument", lval->sym->name);
539 /* move the rname if any to the name for both val & sym */
540 /* and leave a copy of it in the symbol table */
541 if (lval->sym->rname[0])
543 char buffer[SDCC_NAME_MAX];
544 strcpy (buffer, lval->sym->rname);
545 lval->sym = copySymbol (lval->sym);
546 strcpy (lval->sym->rname, buffer);
547 strcpy (lval->name, strcpy (lval->sym->name, lval->sym->rname));
548 addSym (SymbolTab, lval->sym, lval->sym->name,
549 lval->sym->level, lval->sym->block, 1);
550 lval->sym->_isparm = 1;
551 addSet (&operKeyReset, lval->sym);
559 /*-----------------------------------------------------------------*/
560 /* allocLocal - allocate local variables */
561 /*-----------------------------------------------------------------*/
563 allocLocal (symbol * sym)
566 /* generate an unique name */
567 sprintf (sym->rname, "%s%s_%s_%d_%d",
569 currFunc->name, sym->name, sym->level, sym->block);
572 sym->localof = currFunc;
574 /* if this is a static variable */
575 if (IS_STATIC (sym->etype))
582 /* if volatile then */
583 if (IS_VOLATILE (sym->etype))
586 /* this is automatic */
588 /* if it to be placed on the stack */
589 if (options.stackAuto || reentrant) {
591 if (options.useXstack) {
592 /* PENDING: stack direction for xstack */
593 SPEC_OCLS (sym->etype) = xstack;
594 SPEC_STAK (sym->etype) = sym->stack = (xstackPtr + 1);
595 xstackPtr += getSize (sym->type);
597 SPEC_OCLS (sym->etype) = istack;
598 if (port->stack.direction > 0) {
599 SPEC_STAK (sym->etype) = sym->stack = (stackPtr + 1);
600 stackPtr += getSize (sym->type);
602 stackPtr -= getSize (sym->type);
603 SPEC_STAK (sym->etype) = sym->stack = stackPtr;
610 /* else depending on the storage class specified */
611 if (SPEC_SCLS (sym->etype) == S_XDATA)
613 SPEC_OCLS (sym->etype) = xdata;
618 if (SPEC_SCLS (sym->etype) == S_CODE && !sym->_isparm) {
619 SPEC_OCLS (sym->etype) = statsg;
624 if (SPEC_SCLS (sym->etype) == S_IDATA)
626 SPEC_OCLS (sym->etype) = idata;
632 /* if this is a function then assign code space */
633 if (IS_FUNC (sym->type))
635 SPEC_OCLS (sym->etype) = code;
639 /* if this is a SFR or SBIT */
640 if (SPEC_SCLS (sym->etype) == S_SFR ||
641 SPEC_SCLS (sym->etype) == S_SBIT)
644 /* if both absolute address & initial */
645 /* value specified then error */
646 if (IS_ABSOLUTE (sym->etype) && sym->ival)
648 werror (E_SFR_INIT, sym->name);
652 SPEC_OCLS (sym->etype) =
653 (SPEC_SCLS (sym->etype) == S_SFR ? sfr : sfrbit);
659 /* if this is a bit variable and no storage class */
660 if (SPEC_NOUN (sym->etype) == V_BIT
661 && (SPEC_SCLS (sym->etype) == S_BIT))
663 SPEC_OCLS (sym->etype) = bit;
668 if (SPEC_SCLS (sym->etype) == S_DATA)
670 SPEC_OCLS (sym->etype) = (options.noOverlay ? data : overlay);
675 if (SPEC_SCLS (sym->etype) == S_EEPROM)
677 SPEC_OCLS (sym->etype) = eeprom;
682 /* again note that we have put it into the overlay segment
683 will remove and put into the 'data' segment if required after
684 overlay analysis has been done */
685 if (options.model == MODEL_SMALL) {
686 SPEC_OCLS (sym->etype) =
687 (options.noOverlay ? port->mem.default_local_map
690 SPEC_OCLS (sym->etype) = port->mem.default_local_map;
695 /*-----------------------------------------------------------------*/
696 /* deallocLocal - deallocates the local variables */
697 /*-----------------------------------------------------------------*/
699 deallocLocal (symbol * csym)
703 for (sym = csym; sym; sym = sym->next)
708 /* if it is on the stack */
711 if (options.useXstack)
712 xstackPtr -= getSize (sym->type);
714 stackPtr -= getSize (sym->type);
716 /* if not used give a warning */
717 if (!sym->isref && !IS_STATIC (sym->etype))
718 werror (W_NO_REFERENCE, currFunc->name,
719 "local variable", sym->name);
720 /* now delete it from the symbol table */
721 deleteSym (SymbolTab, sym, sym->name);
725 /*-----------------------------------------------------------------*/
726 /* overlay2data - moves declarations from the overlay seg to data */
727 /*-----------------------------------------------------------------*/
733 for (sym = setFirstItem (overlay->syms); sym;
734 sym = setNextItem (overlay->syms))
737 SPEC_OCLS (sym->etype) = data;
741 setToNull ((void **) &overlay->syms);
745 /*-----------------------------------------------------------------*/
746 /* overlay2Set - will add all symbols from the overlay segment to */
747 /* the set of sets containing the overlable symbols */
748 /*-----------------------------------------------------------------*/
755 for (sym = setFirstItem (overlay->syms); sym;
756 sym = setNextItem (overlay->syms))
762 setToNull ((void **) &overlay->syms);
763 addSet (&ovrSetSets, oset);
767 /*-----------------------------------------------------------------*/
768 /* allocVariables - creates decl & assign storage class for a v */
769 /*-----------------------------------------------------------------*/
771 allocVariables (symbol * symChain)
778 /* go thru the symbol chain */
779 for (sym = symChain; sym; sym = sym->next)
782 /* if this is a typedef then add it */
783 /* to the typedef table */
784 if (IS_TYPEDEF (sym->etype))
786 /* check if the typedef already exists */
787 csym = findSym (TypedefTab, NULL, sym->name);
788 if (csym && csym->level == sym->level)
789 werror (E_DUPLICATE_TYPEDEF, sym->name);
791 addSym (TypedefTab, sym, sym->name, sym->level, sym->block, 0);
792 continue; /* go to the next one */
794 /* make sure it already exist */
795 csym = findSymWithLevel (SymbolTab, sym);
796 if (!csym || (csym && csym->level != sym->level))
799 /* check the declaration */
802 /* if this is a function or a pointer to function */
803 /* then args processing */
804 if (funcInChain (csym->type))
806 #if 1 // jwk: TODO should have been done already in addDecl() (oclass????)
807 processFuncArgs (csym);
809 /* if register bank specified then update maxRegBank */
810 if (maxRegBank < FUNC_REGBANK (csym->type))
811 maxRegBank = FUNC_REGBANK (csym->type);
814 /* if this is a extern variable then change the */
815 /* level to zero temporarily */
816 if (IS_EXTERN (csym->etype) || IS_FUNC (csym->type))
818 saveLevel = csym->level;
822 /* if this is a literal then it is an enumerated */
823 /* type so need not allocate it space for it */
824 if (IS_LITERAL (sym->etype))
827 /* generate the actual declaration */
832 stack += getSize (csym->type);
837 /* restore the level */
838 if (IS_EXTERN (csym->etype) || IS_FUNC (csym->type))
839 csym->level = saveLevel;
845 /*-----------------------------------------------------------------*/
846 /* redoStackOffsets :- will reassign the values for stack offsets */
847 /*-----------------------------------------------------------------*/
849 redoStackOffsets (void)
855 /* after register allocation is complete we know
856 which variables will need to be assigned space
857 on the stack. We will eliminate those variables
858 which do not have the allocReq flag thus reducing
860 for (sym = setFirstItem (istack->syms); sym;
861 sym = setNextItem (istack->syms))
864 int size = getSize (sym->type);
865 /* nothing to do with parameters so continue */
866 if ((sym->_isparm && !IS_REGPARM (sym->etype)))
869 if (IS_AGGREGATE (sym->type))
871 if (port->stack.direction > 0)
873 SPEC_STAK (sym->etype) = sym->stack = (sPtr + 1);
879 SPEC_STAK (sym->etype) = sym->stack = sPtr;
884 /* if allocation not required then subtract
885 size from overall stack size & continue */
888 currFunc->stack -= size;
889 SPEC_STAK (currFunc->etype) -= size;
893 if (port->stack.direction > 0)
895 SPEC_STAK (sym->etype) = sym->stack = (sPtr + 1);
901 SPEC_STAK (sym->etype) = sym->stack = sPtr;
905 /* do the same for the external stack */
907 for (sym = setFirstItem (xstack->syms); sym;
908 sym = setNextItem (xstack->syms))
911 int size = getSize (sym->type);
912 /* nothing to do with parameters so continue */
913 if ((sym->_isparm && !IS_REGPARM (sym->etype)))
916 if (IS_AGGREGATE (sym->type))
918 SPEC_STAK (sym->etype) = sym->stack = (xsPtr + 1);
923 /* if allocation not required then subtract
924 size from overall stack size & continue */
927 currFunc->xstack -= size;
928 SPEC_STAK (currFunc->etype) -= size;
932 SPEC_STAK (sym->etype) = sym->stack = (xsPtr + 1);
936 /* if the debug option is set then output the
937 symbols to the map file */
940 for (sym = setFirstItem (istack->syms); sym;
941 sym = setNextItem (istack->syms))
942 cdbSymbol (sym, cdbFile, FALSE, FALSE);
944 for (sym = setFirstItem (xstack->syms); sym;
945 sym = setNextItem (xstack->syms))
946 cdbSymbol (sym, cdbFile, FALSE, FALSE);
950 /*-----------------------------------------------------------------*/
951 /* printAllocInfoSeg- print the allocation for a given section */
952 /*-----------------------------------------------------------------*/
954 printAllocInfoSeg (memmap * map, symbol * func, FILE * of)
963 for (sym = setFirstItem (map->syms); sym;
964 sym = setNextItem (map->syms))
969 if (sym->localof != func)
971 fprintf (of, ";%-25s Allocated to ", sym->name);
973 /* if assigned to registers */
974 if (!sym->allocreq && sym->reqv)
977 sym = OP_SYMBOL (sym->reqv);
978 fprintf (of, "registers ");
979 for (i = 0; i < 4 && sym->regs[i]; i++)
980 fprintf (of, "%s ", port->getRegName (sym->regs[i]));
988 fprintf (of, "stack - offset %d\n", sym->stack);
992 /* otherwise give rname */
993 fprintf (of, "in memory with name '%s'\n", sym->rname);
997 /*-----------------------------------------------------------------*/
998 /* canOverlayLocals - returns true if the local variables can overlayed */
999 /*-----------------------------------------------------------------*/
1001 canOverlayLocals (eBBlock ** ebbs, int count)
1004 /* if staticAuto is in effect or the current function
1005 being compiled is reentrant or the overlay segment
1006 is empty or no overlay option is in effect then */
1007 if (options.noOverlay ||
1008 options.stackAuto ||
1010 (IFFUNC_ISREENT (currFunc->type) ||
1011 FUNC_ISISR (currFunc->type))) ||
1012 elementsInSet (overlay->syms) == 0)
1016 /* otherwise do thru the blocks and see if there
1017 any function calls if found then return false */
1018 for (i = 0; i < count; i++)
1022 for (ic = ebbs[i]->sch; ic; ic = ic->next)
1024 if (ic->op == CALL) {
1025 sym_link *ftype = operandType(IC_LEFT(ic));
1026 /* builtins only can use overlays */
1027 if (!IFFUNC_ISBUILTIN(ftype)) return FALSE;
1028 } else if (ic->op == PCALL) return FALSE;
1032 /* no function calls found return TRUE */
1036 /*-----------------------------------------------------------------*/
1037 /* doOverlays - move the overlay segment to appropriate location */
1038 /*-----------------------------------------------------------------*/
1040 doOverlays (eBBlock ** ebbs, int count)
1042 /* check if the parameters and local variables
1043 of this function can be put in the overlay segment
1044 This check is essentially to see if the function
1045 calls any other functions if yes then we cannot
1047 if (canOverlayLocals (ebbs, count))
1048 /* if we can then put the parameters &
1049 local variables in the overlay set */
1052 /* otherwise put them into data where
1057 /*-----------------------------------------------------------------*/
1058 /* printAllocInfo - prints allocation information for a function */
1059 /*-----------------------------------------------------------------*/
1061 printAllocInfo (symbol * func, FILE * of)
1066 /* must be called after register allocation is complete */
1067 fprintf (of, ";------------------------------------------------------------\n");
1068 fprintf (of, ";Allocation info for local variables in function '%s'\n", func->name);
1069 fprintf (of, ";------------------------------------------------------------\n");
1071 printAllocInfoSeg (xstack, func, of);
1072 printAllocInfoSeg (istack, func, of);
1073 printAllocInfoSeg (code, func, of);
1074 printAllocInfoSeg (data, func, of);
1075 printAllocInfoSeg (xdata, func, of);
1076 printAllocInfoSeg (idata, func, of);
1077 printAllocInfoSeg (sfr, func, of);
1078 printAllocInfoSeg (sfrbit, func, of);