diff options
Diffstat (limited to 'ir.h')
| -rw-r--r-- | ir.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -12,7 +12,8 @@ typedef enum { T_TOP, /* may or may not be a constant */ T_CONST, /* known compile-time constant */ T_BOT, /* known not a constant */ - T_CTRL /* bottom of control flow */ + T_CTRL, /* control flow bottom */ + T_XCTRL, /* control flow top (dead) */ } TypeLevel; typedef enum { @@ -75,7 +76,7 @@ typedef struct Node { int walked; NodeType type; LexSpan src_pos; - NodeInputs in; + NodeInputs in; /* note: index 0 used for control flow */ NodeOutputs out; Value val; }; @@ -133,7 +134,7 @@ void node_add_in(Proc *p, Node *a, Node *b); void node_remove(Proc *p, Node *src, Node *dest); Node *node_new_empty(Proc *p, NodeType t); -Node *node_newv(Proc *p, NodeType t, ...); +Node *node_newv(Proc *p, NodeType t, Node *ctrl, ...); Node *node_dedup_lit(Proc *p, Value v); Value node_compute(Node *n, Lexer *l); Node *node_peephole(Node *n, Proc *p, Lexer *l); @@ -153,5 +154,6 @@ NameBinding *scope_find(Scope *scope, Str name); NameBinding *scope_bind(Scope *scope, Str name, Node *value, LexSpan pos, Proc *proc); NameBinding *scope_update(Scope *scope, Str name, Node *to, Proc *proc); void scope_collect(Scope *scope, Proc *proc, ScopeNameList *nl, Arena *arena); +void scope_uncollect(Scope *scope, Proc *proc, ScopeNameList *nl); #endif |
