Added eBBlockNum to iCode .. now we know which basic block this iCode belongs to
[fw/sdcc] / src / SDCCicode.h
index ae5be9a1abf024c4c9f620bd3176dde5939e80ec..aca2f5ce7afa49457e44642813e1ae0ec42d8c84 100644 (file)
@@ -49,6 +49,7 @@ typedef enum
 OPTYPE;
 
 #define IS_SYMOP(op) (op && op->type == SYMBOL)
+#define IS_VALOP(op) (op && op->type == VALUE)
 #define ADDTOCHAIN(x) addSetHead(&iCodeChain,x)
 
 #define LRFTYPE       sym_link *ltype = operandType(left), \
@@ -67,11 +68,13 @@ OPTYPE;
 #define OP_SYMBOL(op)      op->operand.symOperand
 #define OP_SYM_TYPE(op)    op->operand.symOperand->type
 #define OP_SYM_ETYPE(op)   op->operand.symOperand->etype
+#define OP_VALUE(op)       op->operand.valOperand
 #define SPIL_LOC(op)       op->operand.symOperand->usl.spillLoc
 #define OP_LIVEFROM(op)    op->operand.symOperand->liveFrom
 #define OP_LIVETO(op)      op->operand.symOperand->liveTo
 #define OP_REQV(op)        op->operand.symOperand->reqv
 #define OP_ISLIVE_FCALL(op) (IS_ITEMP(op) && OP_SYMBOL(op)->isLiveFcall)
+#define SYM_SPIL_LOC(sym)  sym->usl.spillLoc
 
 /* typedef for operand */
 typedef struct operand
@@ -107,10 +110,11 @@ operand;
 #define IC_TRUE(x)   (x)->ulrrcnd.cnd.trueLabel
 #define IC_FALSE(x)  (x)->ulrrcnd.cnd.falseLabel
 #define IC_LABEL(x)  (x)->argLabel.label
-#define IC_ARGS(x)   (x)->argLabel.args
+// jwk #define IC_ARGS(x)   (x)->argLabel.args
 #define IC_JTCOND(x) (x)->ulrrcnd.jmpTab.condition
 #define IC_JTLABELS(x) (x)->ulrrcnd.jmpTab.labels
 #define IC_INLINE(x) (x)->inlineAsm
+#define IC_ARRAYILIST(x) (x)->arrayInitList
 
 typedef struct iCode
   {
@@ -166,17 +170,19 @@ typedef struct iCode
     union
       {
        symbol *label;          /* for a goto statement     */
-       value *args;
+       // jwk value *args;            /* for a function */
       }
     argLabel;
 
     char *inlineAsm;           /* pointer to inline assembler code */
+    literalList *arrayInitList; /* point to array initializer list. */
 
     int lineno;                        /* file & lineno for debug information */
     char *filename;
     
     int parmBytes;             /* if call/pcall, count of parameter bytes 
                                   on stack */
+    int eBBlockNum;             /* belongs to which eBBlock */
   }
 iCode;
 
@@ -205,6 +211,7 @@ iCodeTable;
                       x->op == IPOP     ||     \
                       x->op == JUMPTABLE ||    \
                       x->op == RECEIVE  ||     \
+                     x->op == ARRAYINIT ||    \
                      SKIP_IC1(x)||  \
                      x->op == SEND         )
 
@@ -257,8 +264,10 @@ iCodeTable;
 #define ASSIGNMENT_TO_SELF(ic) (!POINTER_SET(ic) && !POINTER_GET(ic) && \
                                ic->op == '=' && IC_RESULT(ic)->key == IC_RIGHT(ic)->key )
 
+#define IS_CAST_ICODE(ic) (ic && ic->op == CAST)
 #define SET_ISADDR(op,v) {op = operandFromOperand(op); op->isaddr = v;}
 #define SET_RESULT_RIGHT(ic) {SET_ISADDR(IC_RIGHT(ic),0); SET_ISADDR(IC_RESULT(ic),0);}
+#define IS_ASSIGN_ICODE(ic) (ASSIGNMENT(ic) && !POINTER_SET(ic))
 
 #define OP_DEFS(op) op->operand.symOperand->defs
 #define OP_USES(op) op->operand.symOperand->uses