scc

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

commit 80847b8fce363a8f18ed50697d1133c7c769fb1d
parent c56363ebc297fa01ebe8ee7b5ebb0626bc629676
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 27 Jan 2016 16:52:15 +0100

[cc1] Emit type in switch table constants

It makes the IR more regular.

Diffstat:
Mcc1/code.c | 2+-
Mcc1/tests/test012.c | 12++++++------
Mcc1/tests/test036.c | 2+-
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/cc1/code.c b/cc1/code.c @@ -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 @@ -13,7 +13,7 @@ A3 I "x L6 j L4 L5 - t #1 + t #N1 v L6 #I0 L4 s L8 A3 @@ -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 @@ -41,7 +41,7 @@ L17 h #I3 j L15 L16 - t #1 + t #N1 v L17 #I1 L15 s L19 A3 @@ -51,7 +51,7 @@ L21 h #I4 j L18 L19 - t #1 + t #N1 v L21 #I1 L18 s L23 A3 @@ -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 @@ -37,7 +37,7 @@ L19 L12 j L8 L9 - t #8 + t #N8 v L19 #I1 v L18 #I2 v L17 #I3