aboutsummaryrefslogtreecommitdiff
path: root/ssa.h
diff options
context:
space:
mode:
Diffstat (limited to 'ssa.h')
-rw-r--r--ssa.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/ssa.h b/ssa.h
index bf49f0f..819428d 100644
--- a/ssa.h
+++ b/ssa.h
@@ -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);