return ep;
}
+/*-----------------------------------------------------------------*/
+/* dumpLiveRanges - dump liverange information into a file */
+/*-----------------------------------------------------------------*/
+void dumpLiveRanges (char *ext,hTab *liveRanges)
+{
+ FILE *file;
+ symbol *sym;
+ int k;
+
+ if (ext) {
+ /* create the file name */
+ strcpy(buffer,srcFileName);
+ strcat(buffer,ext);
+
+ if (!(file = fopen(buffer,"a+"))) {
+ werror(E_FILE_OPEN_ERR,buffer);
+ exit(1);
+ }
+ } else
+ file = stdout;
+
+ for (sym = hTabFirstItem(liveRanges,&k); sym ;
+ sym = hTabNextItem(liveRanges,&k)) {
+
+ fprintf (file,"%s [k%d lr%d:%d so:%d]{ re%d rm%d}",
+ (sym->rname[0] ? sym->rname : sym->name),
+ sym->key,
+ sym->liveFrom,sym->liveTo,
+ sym->stack,
+ sym->isreqv,sym->remat
+ );
+
+ fprintf(file,"{"); printTypeChain(sym->type,file);
+ if (sym->usl.spillLoc) {
+ fprintf(file,"}{ sir@ %s",sym->usl.spillLoc->rname);
+ }
+ fprintf(file,"}");
+
+ /* if assigned to registers */
+ if (sym->nRegs) {
+ if (sym->isspilt) {
+ if (!sym->remat)
+ if (sym->usl.spillLoc)
+ fprintf(file,"[%s]",(sym->usl.spillLoc->rname[0] ?
+ sym->usl.spillLoc->rname :
+ sym->usl.spillLoc->name));
+ else
+ fprintf(file,"[err]");
+ else
+ fprintf(file,"[remat]");
+ }
+ else {
+ int i;
+ fprintf(file,"[");
+ for(i=0;i<sym->nRegs;i++)
+ fprintf(file,"%s ", port->getRegName(sym->regs[i]));
+ fprintf(file,"]");
+ }
+ }
+ fprintf(file,"\n");
+ }
+
+ fclose(file);
+}
/*-----------------------------------------------------------------*/
/* dumpEbbsToFileExt - writeall the basic blocks to a file */
/*-----------------------------------------------------------------*/
FILE *of;
int i;
- /* create the file name */
- strcpy(buffer,srcFileName);
- strcat(buffer,ext);
-
- if (!(of = fopen(buffer,"a+"))) {
- werror(E_FILE_OPEN_ERR,buffer);
- exit(1);
- }
+ if (ext) {
+ /* create the file name */
+ strcpy(buffer,srcFileName);
+ strcat(buffer,ext);
+
+ if (!(of = fopen(buffer,"a+"))) {
+ werror(E_FILE_OPEN_ERR,buffer);
+ exit(1);
+ }
+ } else
+ of = stdout;
for (i=0; i < count ; i++ ) {
fprintf(of,"\n----------------------------------------------------------------\n");
first, we will remove it from the overlay segment
after the overlay determination has been done */
SPEC_OCLS(lval->etype) = SPEC_OCLS(lval->sym->etype) =
- ( options.model ? port->mem.default_local_map :
+ ( options.model ? port->mem.default_local_map :
(options.noOverlay ? port->mem.default_local_map
:overlay ));
/* if this is a static variable */
if ( IS_STATIC (sym->etype)) {
-/* SPEC_OCLS(sym->etype) = (options.model ? xdata : data ); */
SPEC_OCLS(sym->etype) = port->mem.default_local_map;
allocIntoSeg (sym);
sym->allocreq = 1;
sym->nRegs) >= result->nRegs)
) {
- for (i = 0 ; i < max(sym->nRegs,result->nRegs) ; i++)
+ for (i = 0 ; i < result->nRegs ; i++)
if (i < sym->nRegs )
result->regs[i] = sym->regs[i] ;
else
/* redo that offsets for stacked automatic variables */
redoStackOffsets ();
- if (options.dump_rassgn)
+ if (options.dump_rassgn) {
dumpEbbsToFileExt(".dumprassgn",ebbs,count);
+ dumpLiveRanges(".lrange",liveRanges);
+ }
/* now get back the chain */
ic = iCodeLabelOptimize(iCodeFromeBBlock (ebbs,count));