diff options
author | Michael Forney <mforney@mforney.org> | 2019-04-24 22:17:41 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-04-24 22:32:22 -0700 |
commit | b38f2d82a80ea203f37c88746639a0efa8b66fbf (patch) | |
tree | fd1ef9145ec3f18b67f90f233653eb5f65119a3f /expr.c | |
parent | b95f69c821941fc73ff1bf397c549189bd5fce9a (diff) |
Use a common member for expression op
Diffstat (limited to 'expr.c')
-rw-r--r-- | expr.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -137,7 +137,7 @@ mkunaryexpr(enum tokenkind op, struct expr *base) if (base->kind == EXPRBITFIELD) error(&tok.loc, "cannot take address of bit-field"); expr = mkexpr(EXPRUNARY, mkpointertype(base->type, base->qual)); - expr->unary.op = op; + expr->op = op; expr->unary.base = base; return expr; case TMUL: @@ -146,7 +146,7 @@ mkunaryexpr(enum tokenkind op, struct expr *base) expr = mkexpr(EXPRUNARY, base->type->base); expr->qual = base->type->qual; expr->lvalue = true; - expr->unary.op = op; + expr->op = op; expr->unary.base = base; return decay(expr); } @@ -280,7 +280,7 @@ mkbinaryexpr(struct location *loc, enum tokenkind op, struct expr *l, struct exp fatal("internal error: unknown binary operator %d", op); } e = mkexpr(EXPRBINARY, t); - e->binary.op = op; + e->op = op; e->binary.l = l; e->binary.r = r; @@ -643,7 +643,7 @@ mkincdecexpr(enum tokenkind op, struct expr *base, bool post) if (base->qual & QUALCONST) error(&tok.loc, "operand of '%s' operator is const qualified", tokstr[op]); e = mkexpr(EXPRINCDEC, base->type); - e->incdec.op = op; + e->op = op; e->incdec.base = base; e->incdec.post = post; return e; |