From 1d0cb4a804fd276a9f768680f59ecd4642066e28 Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 29 Apr 2014 14:09:32 +0800 Subject: use pointer for operands inside CInst --- ssa.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'ssa.h') diff --git a/ssa.h b/ssa.h index cdd1894..75d166d 100644 --- a/ssa.h +++ b/ssa.h @@ -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; -- cgit v1.2.3