diff options
author | Teddy <ted.sybil@gmail.com> | 2014-04-29 14:09:32 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2014-04-29 14:09:32 +0800 |
commit | 1d0cb4a804fd276a9f768680f59ecd4642066e28 (patch) | |
tree | ed701019033e04c37a3a835cdea524d6993a3031 /ssa.h | |
parent | b9dda0c12e15f178d99eaea687f86d2b4e11fe16 (diff) |
use pointer for operands inside CInst
Diffstat (limited to 'ssa.h')
-rw-r--r-- | ssa.h | 22 |
1 files changed, 19 insertions, 3 deletions
@@ -2,7 +2,9 @@ #define SSA_H #include "const.h" #include "semantics.h" -typedef struct COpr { +typedef struct COpr COpr; +typedef COpr *COpr_t; +struct COpr { enum { VAR, TMP, @@ -14,7 +16,7 @@ typedef struct COpr { int imm; char *str; } info; -} COpr; +}; typedef struct CInst CInst; typedef CInst *CInst_t; @@ -34,13 +36,27 @@ struct CInst { LOR, LAND, NEG, NOR, SEQ, EQ, NE, LT, GT, LE, GE } op; - COpr dest, src1, src2; + COpr_t dest, src1, src2; CInst_t next, prev; }; +typedef struct COprList COprList; +typedef COprList *COprList_t; +struct COprList { + COpr opr; + COprList_t next; +}; +typedef struct CPhi CPhi; +typedef CPhi *CPhi_t; +struct CPhi { + COpr dest; + COprList_t params; +}; + typedef struct CBlock CBlock; typedef CBlock *CBlock_t; struct CBlock { + CPhi_t phis; CInst_t insts; /* instructions */ CBlock_t next, prev; int id; |