#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
extern int xa51_ptrRegReq;
extern int xa51_nRegs;
-extern FILE *codeOutFile;
+extern struct dbuf_s *codeOutBuf;
static lineNode *lineHead = NULL;
static lineNode *lineCurr = NULL;
static void emitcode (char *inst, char *fmt,...) {
va_list ap;
char lb[INITIAL_INLINEASM];
- unsigned char *lbp = lb;
+ char *lbp = lb;
va_start (ap, fmt);
emitcode (";", "genFunction %s", sym->rname);
/* print the allocation information */
- printAllocInfo (currFunc, codeOutFile);
+ printAllocInfo (currFunc, codeOutBuf);
emitcode ("", "%s:", sym->rname);
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
peepHole (&lineHead);
/* now do the actual printing */
- printLine (lineHead, codeOutFile);
+ printLine (lineHead, codeOutBuf);
return;
}