diff options
author | Ori Bernstein <ori@eigenstate.org> | 2015-09-26 13:21:11 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2015-09-26 13:21:11 -0700 |
commit | f4a4987fb85dc9ea146146068734988bb046a3ab (patch) | |
tree | 3eac5098cdb2cd9a48996bedbeb26d52d2c0db9c /6/isel.c | |
parent | e1bd55e7d0fd87b66041c1f90cc4cba370cb25ed (diff) | |
download | mc-f4a4987fb85dc9ea146146068734988bb046a3ab.tar.gz |
Fix up constant initialization a bit.
Diffstat (limited to '6/isel.c')
-rw-r--r-- | 6/isel.c | 18 |
1 files changed, 2 insertions, 16 deletions
@@ -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); |