commit 48c5ae1798901462bcc7dab2413384636171330e
Author:     Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Tue Apr 19 04:41:55 2016 +0200
Commit:     Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Tue Apr 19 04:41:55 2016 +0200

    [cc2] Put type constant in a different enum
    
    This is the last step to clean the main enum of cc2.h.
    Enum op has now only constant related to ops used in nodes.

diff --git a/cc2/cc2.h b/cc2/cc2.h
index 2b34008..c4e5dee 100644
--- a/cc2/cc2.h
+++ b/cc2/cc2.h
@@ -20,10 +20,12 @@ enum sclass {
        SPRIV     = 'Y',
        SLOCAL    = 'T',
        SMEMB     = 'M',
+       SCONST    = '#',
+       STRING    = '"',
+       SNONE     = 0
 };
 
-enum op {
-       /* types */
+enum types {
        ELLIPSIS = 'E',
        INT8     = 'C',
        INT16    = 'I',
@@ -42,12 +44,11 @@ enum op {
        FLOAT    = 'J',
        DOUBLE   = 'D',
        LDOUBLE  = 'H',
-       VOID     = '0',
-       ONAME    = '"',
+       VOID     = '0'
+};
+
+enum op {
        /* kind of operand */
-       NONE     = 0,
-       CONST    = '#',
-       STRING   = '"',
        /* operands */
        OMEM     = 'M',
        OTMP     = 'T',
@@ -100,8 +101,6 @@ enum op {
        ODEFAULT = 'f',
        OTABLE   = 't',
        OSWITCH  = 's',
-       OEPARS   = '\\',
-       OSTMT    = '\t'
 };
 
 enum nerrors {
diff --git a/cc2/code.c b/cc2/code.c
index fd60dc2..be77fe1 100644
--- a/cc2/code.c
+++ b/cc2/code.c
@@ -22,7 +22,7 @@ nextpc(void)
         }
 
         new->prev = pc;
-        new->to.kind = new->from2.kind = new->from1.kind = NONE;
+        new->to.kind = new->from2.kind = new->from1.kind = SNONE;
         pc = new;
 }
 
@@ -33,7 +33,7 @@ addr(Node *np, Addr *addr)
        case SREG:
                addr->u.reg = np->u.reg;
                break;
-       case CONST:
+       case SCONST:
                abort();
                break;
        case SLABEL:

Reply via email to