diff options
Diffstat (limited to 'ssa.h')
-rw-r--r-- | ssa.h | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -2,6 +2,10 @@ #define SSA_H #include "const.h" #include "semantics.h" + +typedef struct CInst CInst; +typedef CInst *CInst_t; + typedef struct COpr COpr; typedef COpr *COpr_t; struct COpr { @@ -16,10 +20,17 @@ struct COpr { int imm; char *str; } info; + int sub; + CInst_t def; +}; + +typedef struct COList COList; +typedef COList *COList_t; +struct COList { + COpr_t opr; + COList_t next; }; -typedef struct CInst CInst; -typedef CInst *CInst_t; struct CInst { enum { BEQZ, /* conditional jump */ @@ -56,6 +67,7 @@ struct CBlock { CBlock_t next, prev; int id; int ref; /* if referenced by any gotos */ + int pred; /* the number of predecessors */ }; typedef struct CBList CBList; @@ -65,6 +77,13 @@ struct CBList { CBList_t next; }; +typedef struct CVList CVList; +typedef CVList *CVList_t; +struct CVList { + CVar_t var; + CVList_t next; +}; + CBlock_t cblock_create(int inc); void cblock_append(CBlock_t cblk, CInst_t inst); void cblock_pappend(CBlock_t cblk, CPhi_t phi); |