//#include "ralloc.h"
struct regs;
+/* When changing these, you must also update the assembler template
+ * in device/lib/libsdcc/macros.inc */
+#define GPTRTAG_DATA 0x00
+#define GPTRTAG_CODE 0x80
+
/*
Post code generation
PC_WILD, /* wildcard - an opcode place holder used
* in the pCode peep hole optimizer */
PC_CSOURCE, /* C-Source Line */
+ PC_ASMDIR, /* Assembler directive */
PC_BAD /* Mark the pCode object as being bad */
} PC_TYPE;
} pCodeComment;
+
/*************************************************
pCodeComment
**************************************************/
} pCodeFlow;
+
/*************************************************
pCodeFlowLink
} pCodeFlowLink;
+
/*************************************************
pCodeInstruction
} pCodeInstruction;
+/*************************************************
+ pCodeAsmDir
+**************************************************/
+
+typedef struct pCodeAsmDir
+{
+ pCodeInstruction pci;
+
+ char *directive;
+ char *arg;
+} pCodeAsmDir;
+
+
/*************************************************
pCodeLabel
**************************************************/
} pCodeLabel;
+
/*************************************************
pCodeFunction
**************************************************/
#define PCFLINK(x)((pCodeFlowLink *)(x))
#define PCW(x) ((pCodeWild *)(x))
#define PCCS(x) ((pCodeCSource *)(x))
+#define PCAD(x) ((pCodeAsmDir *)(x))
#define PCOP(x) ((pCodeOp *)(x))
//#define PCOB(x) ((pCodeOpBit *)(x))
#define isPCL(x) ((PCODE(x)->type == PC_LABEL))
#define isPCW(x) ((PCODE(x)->type == PC_WILD))
#define isPCCS(x) ((PCODE(x)->type == PC_CSOURCE))
+#define isPCASMDIR(x) ((PCODE(x)->type == PC_ASMDIR))
/*
macros for checking pCodeInstruction types
pCode *newpCodeInlineP(char *cP); // Create a new pCode given a char *
pCode *newpCodeFunction(char *g, char *f,int); // Create a new function
pCode *newpCodeLabel(char *name,int key); // Create a new label given a key
-pCode *newpCodeCSource(int ln, char *f, char *l); // Create a new symbol line
+pCode *newpCodeCSource(int ln, char *f, const char *l); // Create a new symbol line
pCode *findNextInstruction(pCode *pci);
pCode *findNextpCode(pCode *pc, PC_TYPE pct);
pCode *pCodeInstructionCopy(pCodeInstruction *pci,int invert);
void pCodeInsertBefore(pCode *pc1, pCode *pc2);
void pCodeDeleteChain(pCode *f,pCode *t);
+pCode *newpCodeAsmDir(char *asdir, char *argfmt, ...);
+
pCodeOp *newpCodeOpLabel(char *name, int key);
pCodeOp *newpCodeOpImmd(char *name, int offset, int index, int code_space,int is_func);
pCodeOp *newpCodeOpLit(int lit);
struct regs * getRegFromInstruction(pCode *pc);
extern void pcode_test(void);
+void resetpCodeStatistics (void);
+void dumppCodeStatistics (FILE *of);
/*-----------------------------------------------------------------*
* pCode objects.