[hackers] [scc] [cc2] Put type constant in a different enum || Roberto E. Vargas Caballero
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
_AT_@ -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',
_AT_@ -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',
_AT_@ -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
_AT_@ -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;
}
_AT_@ -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:
Received on Tue Apr 19 2016 - 23:32:50 CEST
This archive was generated by hypermail 2.3.0
: Tue Apr 19 2016 - 23:36:16 CEST