summaryrefslogtreecommitdiff
path: root/ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/ir.h b/ir.h
index 9351864..72586f2 100644
--- a/ir.h
+++ b/ir.h
@@ -6,10 +6,32 @@
#include "lex.h" /* for error reporting only */
#include "str.h"
+/* types */
+
+typedef enum {
+ T_TOP, /* may or may not be a constant */
+ T_CONST, /* known compile-time constant */
+ T_BOT, /* known not a constant */
+} TypeLevel;
+
+typedef enum {
+ T_TUPLE,
+ T_INT
+} BaseType;
+
+typedef struct Type {
+ BaseType t;
+ TypeLevel lvl;
+ struct Type *next;
+} Type;
+
+int type_eql(Type *a, Type *b);
+
/* nodes */
typedef enum {
N_START,
+ N_PROJ,
N_RETURN,
N_KEEPALIVE,
N_LIT,
@@ -22,13 +44,6 @@ typedef enum {
const char *node_type_name(NodeType t);
-typedef enum {
- T_BOT,
- T_TOP,
- T_CONST,
- T_INT
-} Type;
-
typedef struct {
Type type;
union {