summaryrefslogtreecommitdiff
path: root/parse/specialize.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-07-09 23:55:41 -0700
committerOri Bernstein <ori@eigenstate.org>2015-07-09 23:55:41 -0700
commit12df9f45f4f383a6bdf8939b44a3b499edee853e (patch)
tree8d288c88dffe8cdf01d266a428bd8870d3e8c581 /parse/specialize.c
parent6d4651504d015f853c5ce79e77c73b5b8d48793f (diff)
downloadmc-12df9f45f4f383a6bdf8939b44a3b499edee853e.tar.gz
Refactor namespaces.
We no longer store subnamespaces in the stab node; now they're a part of the file.
Diffstat (limited to 'parse/specialize.c')
-rw-r--r--parse/specialize.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse/specialize.c b/parse/specialize.c
index 2500454..4145d6d 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -164,7 +164,7 @@ static void fixup(Node *n)
if (n->expr.op == Ovar) {
ns = curstab();
if (n->expr.args[0]->name.ns)
- ns = getns_str(ns, n->expr.args[0]->name.ns);
+ ns = getns(file, n->expr.args[0]->name.ns);
if (!ns)
fatal(n, "No namespace %s\n", n->expr.args[0]->name.ns);
d = getdcl(ns, n->expr.args[0]);
@@ -393,7 +393,7 @@ Node *specializedcl(Node *g, Type *to, Node **name)
n = genericname(g, to);
*name = n;
if (n->name.ns)
- st = getns_str(curstab(), n->name.ns);
+ st = getns(file, n->name.ns);
else
st = file->file.globls;
if (!st)
@@ -453,7 +453,7 @@ static Node *initdecl(Node *file, Node *name, Type *tyvoidfn)
dcl->decl.isconst = 1;
dcl->decl.isinit = 1;
dcl->decl.isextern = 1;
- putnsdcl(dcl);
+ putdcl(file->file.globls, dcl);
}
return dcl;
}