summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-08 01:06:17 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-08 01:06:17 -0700
commit3b2a10f280a9c927bd678199a90a96f8cddab89c (patch)
treeac3dbb71a50d046af575f2cda53f68a4acadb248 /parse/node.c
parent6cf64ac765264c305b91b3062ef8e3525e83add5 (diff)
downloadmc-3b2a10f280a9c927bd678199a90a96f8cddab89c.tar.gz
Get closer to a working use-before-def check.
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse/node.c b/parse/node.c
index 4bca3a6..ba3cd3c 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -12,7 +12,8 @@
#include "parse.h"
-size_t maxnid;
+Node **nodes;
+size_t nnodes;
Node **decls;
size_t ndecls;
@@ -49,9 +50,10 @@ Node *mknode(Srcloc loc, Ntype nt)
Node *n;
n = zalloc(sizeof(Node));
- n->nid = maxnid++;
+ n->nid = nnodes;
n->type = nt;
n->loc = loc;
+ lappend(&nodes, &nnodes, n);
return n;
}