summary refs log tree commit diff
path: root/lisc/lisc.h
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-07-15 02:55:10 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:28 -0400
commit68c6feefbde175fbc27d8f638d3fbd7e92432171 (patch)
tree06a3042116be2b4003a8c8fd25af99cf53def061 /lisc/lisc.h
parentba1b430524a37ae7ce56428903f39cb500a439a6 (diff)
downloadroux-68c6feefbde175fbc27d8f638d3fbd7e92432171.tar.gz
add pretty printing function
Diffstat (limited to 'lisc/lisc.h')
-rw-r--r--lisc/lisc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h
index 153d70f..3d5e38b 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -16,6 +16,7 @@ enum {
 	NIns    = 256,
 };
 
+typedef struct OpDesc OpDesc;
 typedef struct Ins Ins;
 typedef struct Phi Phi;
 typedef struct Blk Blk;
@@ -29,7 +30,7 @@ enum {
 
 	RMask = 1,
 	RShift = 1,
-	NRefs = ((ushort)-1)>>RShift,
+	NRef = ((ushort)-1)>>RShift,
 };
 
 #define SYM(x)   (((x)<<RShift) | RSym)
@@ -45,8 +46,16 @@ enum {
 
 	/* reserved instructions */
 	OX86Div,
+	OLast
 };
 
+struct OpDesc {
+	int arity;
+	int commut:1;
+	char *name;
+};
+extern OpDesc opdesc[];
+
 enum {
 	JXXX,
 	JRet,
@@ -110,6 +119,7 @@ struct Fn {
 /* parse.c */
 void *alloc(size_t);
 Fn *parsefn(FILE *);
+void printfn(Fn *, FILE *);
 
 /* ssa.c */
 void fillpreds(Fn *);