summaryrefslogtreecommitdiff
path: root/6/isel.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-26 13:21:11 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-26 13:21:11 -0700
commitf4a4987fb85dc9ea146146068734988bb046a3ab (patch)
tree3eac5098cdb2cd9a48996bedbeb26d52d2c0db9c /6/isel.c
parente1bd55e7d0fd87b66041c1f90cc4cba370cb25ed (diff)
downloadmc-f4a4987fb85dc9ea146146068734988bb046a3ab.tar.gz
Fix up constant initialization a bit.
Diffstat (limited to '6/isel.c')
-rw-r--r--6/isel.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/6/isel.c b/6/isel.c
index 22495cb..b7a5ebb 100644
--- a/6/isel.c
+++ b/6/isel.c
@@ -478,26 +478,12 @@ static void clear(Isel *s, Loc *val, size_t sz, size_t align)
}
}
-static int isconstfunc(Isel *s, Node *n)
-{
- Node *d;
-
- if (exprop(n) != Ovar)
- return 0;
- if (!hthas(s->globls, n))
- return 0;
- d = decls[n->expr.did];
- if (d && d->decl.isconst)
- return tybase(decltype(d))->type == Tyfunc;
- return 0;
-}
-
static void call(Isel *s, Node *n)
{
AsmOp op;
Loc *f;
- if (isconstfunc(s, n)) {
+ if (isconstfn(n)) {
op = Icall;
f = locmeml(htget(s->globls, n), NULL, NULL, mode(n));
} else {
@@ -810,7 +796,7 @@ Loc *selexpr(Isel *s, Node *n)
r = loc(s, n);
break;
case Ovar:
- if (isconstfunc(s, n)) {
+ if (isconstfn(n)) {
r = locreg(ModeQ);
a = loc(s, n);
g(s, Ilea, a, r, NULL);