aboutsummaryrefslogtreecommitdiff
path: root/expr.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-24 22:17:41 -0700
committerMichael Forney <mforney@mforney.org>2019-04-24 22:32:22 -0700
commitb38f2d82a80ea203f37c88746639a0efa8b66fbf (patch)
treefd1ef9145ec3f18b67f90f233653eb5f65119a3f /expr.c
parentb95f69c821941fc73ff1bf397c549189bd5fce9a (diff)
Use a common member for expression op
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/expr.c b/expr.c
index 22d48f3..ee498d0 100644
--- a/expr.c
+++ b/expr.c
@@ -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;