[hackers] [scc] [cc1] Emit type in switch table constants || Roberto E. Vargas Caballero
commit 80847b8fce363a8f18ed50697d1133c7c769fb1d
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Jan 27 16:52:15 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Jan 27 16:52:15 2016 +0100
[cc1] Emit type in switch table constants
It makes the IR more regular.
diff --git a/cc1/code.c b/cc1/code.c
index e3db8c4..ff7f27e 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -466,7 +466,7 @@ emitswitcht(unsigned op, void *arg)
Caselist *lcase = arg;
struct scase *p, *next;
- printf("\tt\t#%0x\n", lcase->nr);
+ printf("\tt\t#%c%0x\n", sizettype->letter, lcase->nr);
for (p = lcase->head; p; p = next) {
emitsymid(OCASE, p->label);
emitexp(OEXPR, p->expr);
diff --git a/cc1/tests/test012.c b/cc1/tests/test012.c
index 1810fd3..a6c4dee 100644
--- a/cc1/tests/test012.c
+++ b/cc1/tests/test012.c
_AT_@ -13,7 +13,7 @@ A3 I "x
L6
j L4
L5
- t #1
+ t #N1
v L6 #I0
L4
s L8 A3
_AT_@ -25,13 +25,13 @@ L14
h #I1
j L10
L11
- t #2
+ t #N2
v L12 #I0
f L14
L10
j L7
L8
- t #1
+ t #N1
v L9 #I0
L7
h #I2
_AT_@ -41,7 +41,7 @@ L17
h #I3
j L15
L16
- t #1
+ t #N1
v L17 #I1
L15
s L19 A3
_AT_@ -51,7 +51,7 @@ L21
h #I4
j L18
L19
- t #1
+ t #N1
v L21 #I1
L18
s L23 A3
_AT_@ -63,7 +63,7 @@ L26
h #I1
j L22
L23
- t #3
+ t #N3
v L25 #I1
v L24 #I0
f L26
diff --git a/cc1/tests/test036.c b/cc1/tests/test036.c
index 2309c20..76062df 100644
--- a/cc1/tests/test036.c
+++ b/cc1/tests/test036.c
_AT_@ -37,7 +37,7 @@ L19
L12
j L8
L9
- t #8
+ t #N8
v L19 #I1
v L18 #I2
v L17 #I3
Received on Wed Jan 27 2016 - 16:59:16 CET
This archive was generated by hypermail 2.3.0
: Wed Jan 27 2016 - 17:00:59 CET