shithub: scc

Download patch

ref: 80847b8fce363a8f18ed50697d1133c7c769fb1d
parent: c56363ebc297fa01ebe8ee7b5ebb0626bc629676
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Jan 27 11:52:15 EST 2016

[cc1] Emit type in switch table constants

It makes the IR more regular.

--- a/cc1/code.c
+++ b/cc1/code.c
@@ -466,7 +466,7 @@
 	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);
--- a/cc1/tests/test012.c
+++ b/cc1/tests/test012.c
@@ -13,7 +13,7 @@
 L6
 	j	L4
 L5
-	t	#1
+	t	#N1
 	v	L6	#I0
 L4
 	s	L8	A3
@@ -25,13 +25,13 @@
 	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 @@
 	h	#I3
 	j	L15
 L16
-	t	#1
+	t	#N1
 	v	L17	#I1
 L15
 	s	L19	A3
@@ -51,7 +51,7 @@
 	h	#I4
 	j	L18
 L19
-	t	#1
+	t	#N1
 	v	L21	#I1
 L18
 	s	L23	A3
@@ -63,7 +63,7 @@
 	h	#I1
 	j	L22
 L23
-	t	#3
+	t	#N3
 	v	L25	#I1
 	v	L24	#I0
 	f	L26
--- a/cc1/tests/test036.c
+++ b/cc1/tests/test036.c
@@ -37,7 +37,7 @@
 L12
 	j	L8
 L9
-	t	#8
+	t	#N8
 	v	L19	#I1
 	v	L18	#I2
 	v	L17	#I3