diff options
author | Michael Forney <mforney@mforney.org> | 2019-04-03 00:42:09 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-04-03 00:46:08 -0700 |
commit | b3865e402e426387d4cdccdcd249a02d5ba1bc05 (patch) | |
tree | c5182df0ecd07259d84fcd5a313cb295c09ab8a6 /qbe.c | |
parent | 05e2f624ebe66b4ccc471ce091b3831773bfb4db (diff) |
Make member access its own expression type
Diffstat (limited to 'qbe.c')
-rw-r--r-- | qbe.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -479,6 +479,8 @@ objectaddr(struct func *f, struct expr *e) case EXPRSTRING: d = stringdecl(e); return d->value; + case EXPRMEMBER: + return funcinst(f, IADD, &iptr, funcexpr(f, e->member.base), mkintconst(&iptr, e->member.offset)); case EXPRCOMPOUND: d = mkdecl(DECLOBJECT, e->type, LINKNONE); funcinit(f, d, e->compound.init); @@ -599,6 +601,7 @@ funcexpr(struct func *f, struct expr *e) if (typeprop(e->type) & PROPINT || e->type->kind == TYPEPOINTER) return mkintconst(e->type->repr, e->constant.i); return mkfltconst(e->type->repr, e->constant.f); + case EXPRMEMBER: case EXPRCOMPOUND: l = objectaddr(f, e); return funcload(f, e->type, l); |