* use dynamic memory buffers instead temporary files
[fw/sdcc] / src / xa51 / gen.c
index 508d890fbb7669c4b40e458229bc78e758fc60a0..dd6fabb3bb12d2cddbab32f12fa7b5d7c4047a5a 100755 (executable)
@@ -66,7 +66,7 @@ _G;
 
 extern int xa51_ptrRegReq;
 extern int xa51_nRegs;
-extern FILE *codeOutFile;
+extern struct dbuf_s *codeOutBuf;
 
 static lineNode *lineHead = NULL;
 static lineNode *lineCurr = NULL;
@@ -814,7 +814,7 @@ static void genFunction (iCode * ic) {
   emitcode (";", "genFunction %s", sym->rname);
 
   /* print the allocation information */
-  printAllocInfo (currFunc, codeOutFile);
+  printAllocInfo (currFunc, codeOutBuf);
 
   emitcode ("", "%s:", sym->rname);
 
@@ -1946,7 +1946,9 @@ void genXA51Code (iCode * lic) {
       cln = ic->lineno;
     }
     if (options.iCodeInAsm) {
-      emitcode("", ";ic:%d: %s", ic->key, printILine(ic));
+      char *iLine = printILine(ic);
+      emitcode("", ";ic:%d: %s", ic->key, iLine);
+      dbuf_free(iLine);
     }
 
     /* if the result is marked as
@@ -2156,6 +2158,6 @@ void genXA51Code (iCode * lic) {
     peepHole (&lineHead);
 
   /* now do the actual printing */
-  printLine (lineHead, codeOutFile);
+  printLine (lineHead, codeOutBuf);
   return;
 }