summaryrefslogtreecommitdiff
path: root/parse/export.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2019-02-26 13:03:14 -0800
committerOri Bernstein <ori@markovcorp.com>2019-02-26 13:03:14 -0800
commit02201160614e5f25a7a73d86ed26a1f90fa4f5bb (patch)
treece958c6982673794612cf2ea91ab8b353bf4c243 /parse/export.c
parent16a7bb8f8cc86b22ce157e0944f66f60a556590f (diff)
downloadmc-02201160614e5f25a7a73d86ed26a1f90fa4f5bb.tar.gz
Add support for `__fini__` functions.
Diffstat (limited to 'parse/export.c')
-rw-r--r--parse/export.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/parse/export.c b/parse/export.c
index 136f0de..f63f4b6 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -112,7 +112,7 @@ tagtype(Stab *st, Type *t, int ingeneric, int hidelocal)
}
int
-isexportinit(Node *n)
+isexportval(Node *n)
{
if (n->decl.isgeneric && !n->decl.trait)
return 1;
@@ -185,8 +185,8 @@ tagnode(Stab *st, Node *n, int ingeneric, int hidelocal)
tagtype(st, n->decl.type, ingeneric, hidelocal);
if (hidelocal && n->decl.ispkglocal)
n->decl.vis = Vishidden;
- n->decl.isexportinit = isexportinit(n);
- if (n->decl.isexportinit || ingeneric)
+ n->decl.isexportval = isexportval(n);
+ if (n->decl.isexportval || ingeneric)
tagnode(st, n->decl.init, n->decl.isgeneric, hidelocal);
break;
case Nfunc:
@@ -229,8 +229,12 @@ tagexports(int hidelocal)
/* tag the initializers */
for (i = 0; i < file->file.ninit; i++)
tagnode(st, file->file.init[i], 0, hidelocal);
+ for (i = 0; i < file->file.nfini; i++)
+ tagnode(st, file->file.fini[i], 0, hidelocal);
if (file->file.localinit)
tagnode(st, file->file.localinit, 0, hidelocal);
+ if (file->file.localfini)
+ tagnode(st, file->file.localfini, 0, hidelocal);
/* tag the exported nodes */
k = htkeys(st->dcl, &n);