scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit a8877ebf2f19bf0301f90d9bdff9e23605acfe97
parent 96b6cc1d8be1ad93af98b570e699ff202378cb4b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 16 Sep 2014 15:27:57 +0200

Remove all the operators from xaddable

This codes were added while we were debugging the communication
between cc1 and cc2, but this step is more or less already done,
so it is clear if we remove these ops and incorporate them
one by one.

Diffstat:
Mcc2/cgen.c | 38+++++++++-----------------------------
1 file changed, 9 insertions(+), 29 deletions(-)

diff --git a/cc2/cgen.c b/cc2/cgen.c @@ -109,16 +109,6 @@ xcgen(Node *np) } switch (np->op) { - case OCOMMA: - case ONEG: case OCPL: - case OOR: case OAND: - case OPTR: case OADDR: - case OINC: - case OLT: case OGT: case OGE: case OLE: case OEQ: case ONE: - case OADD: case OSUB: case OASSIG: case OMOD: case ODIV: - case OSHL: case OSHR: - case OBAND: case OBOR: case OBXOR: - break; default: abort(); } @@ -152,10 +142,10 @@ cgen(Symbol *sym, Node *list[]) /* * calculate addresability as follows - * AUTO => 11 - * REGISTER => 13 - * STATIC => 12 - * CONST => 20 + * AUTO => 11 value+fp + * REGISTER => 13 register + * STATIC => 12 (value) + * CONST => 20 $value */ static void xaddable(Node *np) @@ -182,22 +172,12 @@ xaddable(Node *np) case CONST: np->addable = 20; break; - case ONEG: case OCPL: - case OPTR: case OADDR: - xaddable(lp); - break; - case OCOMMA: - case OOR: case OAND: - case OLT: case OGT: case OGE: case OLE: case OEQ: case ONE: - case OINC: - case OASSIG: case OADD: case OSUB: case OMOD: case ODIV: - case OSHL: case OSHR: - case OBAND: case OBOR: case OBXOR: - xaddable(lp); - xaddable(rp); - break; default: - abort(); + if (lp) + xaddable(lp); + if (rp) + xaddable(rp); + break; } if (np->addable > 10)