[hackers] [scc] Remove symbol field from Node || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 19 Jan 2016 15:40:03 +0100 (CET)

commit 3a13451527967209d4e2e9d8bf8248659bfafb3f
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Jan 19 12:17:26 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Jan 19 12:17:26 2016 +0100

    Remove symbol field from Node
    
    This flag gives the same information that field sym
    gives.

diff --git a/cc1/cc1.h b/cc1/cc1.h
index deb12f5..f6f8021 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
_AT_@ -87,7 +87,6 @@ struct node {
         Type *type;
         Symbol *sym;
         bool lvalue : 1;
- bool symbol: 1;
         bool constant : 1;
         struct node *left, *right;
 };
diff --git a/cc1/code.c b/cc1/code.c
index e48eeb3..ad88b32 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -316,7 +316,7 @@ emitdesig(Node *np, Type *tp)
         if (!np) {
                 sym = NULL;
         } else {
- if (!np->symbol)
+ if (!np->sym)
                         goto emit_expression;
                 sym = np->sym;
                 if ((sym->flags & ISINITLST) == 0)
_AT_@ -474,7 +474,7 @@ node(unsigned op, Type *tp, Node *lp, Node *rp)
         np->op = op;
         np->type = tp;
         np->sym = NULL;
- np->constant = np->symbol = np->lvalue = 0;
+ np->constant = np->lvalue = 0;
         np->left = lp;
         np->right = rp;
 
_AT_@ -491,7 +491,6 @@ varnode(Symbol *sym)
         np->type = sym->type;
         np->lvalue = tp->op != FTN && tp->op != ARY;
         np->constant = 0;
- np->symbol = 1;
         np->sym = sym;
         return np;
 }
_AT_@ -503,7 +502,6 @@ constnode(Symbol *sym)
 
         np = node(OSYM, sym->type, NULL, NULL);
         np->type = sym->type;
- np->symbol = 1;
         np->constant = 1;
         np->sym = sym;
         return np;
diff --git a/cc1/expr.c b/cc1/expr.c
index 85e42ef..758c2d9 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
_AT_@ -552,7 +552,7 @@ address(char op, Node *np)
 
         if (BTYPE(np) != FTN) {
                 chklvalue(np);
- if (np->symbol && (np->sym->flags & ISREGISTER))
+ if (np->sym && (np->sym->flags & ISREGISTER))
                         errorp("address of register variable '%s' requested", yytext);
                 if (np->op == OPTR) {
                         Node *new = np->left;
_AT_@ -562,7 +562,7 @@ address(char op, Node *np)
         }
         new = node(op, mktype(np->type, PTR, 0, NULL), np, NULL);
 
- if (np->symbol && np->sym->flags & (ISGLOBAL|ISLOCAL|ISPRIVATE))
+ if (np->sym && np->sym->flags & (ISGLOBAL|ISLOCAL|ISPRIVATE))
                 new->constant = 1;
         return new;
 }
Received on Tue Jan 19 2016 - 15:40:03 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 19 2016 - 15:48:20 CET