summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-05-06 23:41:16 -0700
committerOri Bernstein <ori@eigenstate.org>2015-05-06 23:41:16 -0700
commitfb2f85ca9b8e7033d6d7190ecc59b0120f246830 (patch)
treeee6c3372a32e5a458d06c70207237d612621b024 /parse
parent535af2de79e234b615a2c6e758d778a3639bfc21 (diff)
downloadmc-fb2f85ca9b8e7033d6d7190ecc59b0120f246830.tar.gz
More work towards getting undefined variables to be defined.
Diffstat (limited to 'parse')
-rw-r--r--parse/gram.y1
-rw-r--r--parse/specialize.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/parse/gram.y b/parse/gram.y
index 8190e9c..47f3f0a 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -297,6 +297,7 @@ pkgitem : decl {
size_t i;
for (i = 0; i < $1.nn; i++) {
$1.nl[i]->decl.vis = Visexport;
+ $1.nl[i]->decl.isglobl = 1;
putdcl(file->file.globls, $1.nl[i]);
if ($1.nl[i]->decl.init)
lappend(&file->file.stmts, &file->file.nstmts, $1.nl[i]);
diff --git a/parse/specialize.c b/parse/specialize.c
index 4cb38a0..6cf5aa9 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -327,6 +327,7 @@ static Node *specializenode(Node *n, Htab *tsmap)
r->decl.isconst = n->decl.isconst;
r->decl.isgeneric = n->decl.isgeneric;
r->decl.isextern = n->decl.isextern;
+ r->decl.isglobl = n->decl.isglobl;
if (curstab())
putdcl(curstab(), r);
@@ -418,6 +419,7 @@ Node *specializedcl(Node *g, Type *to, Node **name)
d = mkdecl(g->loc, n, tysubst(g->decl.type, tsmap));
d->decl.isconst = g->decl.isconst;
d->decl.isextern = g->decl.isextern;
+ d->decl.isglobl = g->decl.isglobl;
d->decl.init = specializenode(g->decl.init, tsmap);
putdcl(st, d);