* sim/ucsim/cmd.src/cmdutil.cc: NUL device is detected as CG_FILE type
[fw/sdcc] / src / xa51 / gen.c
index 508d890fbb7669c4b40e458229bc78e758fc60a0..bf86fa619ca685b20ae43a15d41d15e273f5019b 100755 (executable)
 #include "ralloc.h"
 #include "gen.h"
 
-#if defined(__BORLANDC__) || defined(_MSC_VER)
-#define STRCASECMP stricmp
-#else
-#define STRCASECMP strcasecmp
-#endif
-
 extern int allocInfo;
 
 /* this is the down and dirty file with all kinds of
@@ -66,7 +60,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 +808,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 +1940,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 +2152,6 @@ void genXA51Code (iCode * lic) {
     peepHole (&lineHead);
 
   /* now do the actual printing */
-  printLine (lineHead, codeOutFile);
+  printLine (lineHead, codeOutBuf);
   return;
 }