commit 727dee0878e0036d92a89229ee6df24427c655fa
parent 9f1253bc5f2cb319aafc8ba8e3f5523b8eadec60
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 13 Apr 2026 23:54:24 +0200
cc1: Remove BTYPE()
This macros is a leftover of older times where the code was very
different and it does not make sense to keep this macro around
for only a few uses while the fields are used directly everywhere.
Diffstat:
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/cmd/scc-cc/cc1/cc1.h b/src/cmd/scc-cc/cc1/cc1.h
@@ -503,7 +503,6 @@ Node *addrnode(unsigned long long);
void freetree(Node *);
void icode(void);
Node *zeronode(Type *);
-#define BTYPE(np) ((np)->type->op)
/* fold.c */
Node *simplify(Node *);
diff --git a/src/cmd/scc-cc/cc1/expr.c b/src/cmd/scc-cc/cc1/expr.c
@@ -355,7 +355,7 @@ parithmetic(int op, Node *lp, Node *rp)
goto incomplete;
size = sizeofnode(tp->type);
- if (op == OSUB && BTYPE(rp) == PTR) {
+ if (op == OSUB && rp->type->op == PTR) {
if ((rp = convert(rp, lp->type, 0)) == NULL)
goto incorrect;
lp = node(OSUB, pdifftype, lp, rp);
@@ -545,7 +545,7 @@ free_np:
static Node *
content(int op, Node *np)
{
- if (BTYPE(np) != PTR) {
+ if (np->type->op != PTR) {
errorp("invalid argument of memory indirection");
} else {
np = node(op, np->type->type, np, NULL);