summaryrefslogtreecommitdiff
path: root/mi/mi.h
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-10-30 13:27:35 -0400
committerOri Bernstein <ori@eigenstate.org>2014-10-30 13:27:35 -0400
commit28318bd41da29f6e406c55247414cdcf3d071a30 (patch)
tree604401364a8b0f42b427521900a63e25c47c0308 /mi/mi.h
parent87d2d8e139a034216b32cc752d4245837a4cc0f7 (diff)
downloadmc-28318bd41da29f6e406c55247414cdcf3d071a30.tar.gz
Unrename 'opt' -> 'mi'
Diffstat (limited to 'mi/mi.h')
-rw-r--r--mi/mi.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/mi/mi.h b/mi/mi.h
new file mode 100644
index 0000000..9d7408f
--- /dev/null
+++ b/mi/mi.h
@@ -0,0 +1,38 @@
+typedef struct Cfg Cfg;
+typedef struct Bb Bb;
+
+struct Cfg {
+ Node *fn;
+ Bb **bb;
+ Bb *start;
+ Bb *end;
+ size_t nbb;
+
+ /* for building bb */
+ int nextbbid;
+ Htab *lblmap; /* label => Bb mapping */
+ Node **fixjmp;
+ size_t nfixjmp;
+ Bb **fixblk;
+ size_t nfixblk;
+};
+
+struct Bb {
+ int id;
+ char **lbls;
+ size_t nlbls;
+ Node **nl;
+ size_t nnl;
+ Bitset *pred;
+ Bitset *succ;
+};
+
+/* expression folding */
+Node *fold(Node *n, int foldvar);
+/* Takes a reduced block, and returns a flow graph. */
+Cfg *mkcfg(Node *fn, Node **nl, size_t nn);
+void dumpcfg(Cfg *c, FILE *fd);
+void check(Cfg *cfg);
+
+/* pattern matching */
+Node *gensimpmatch(Node *m);