shithub: scc

Download patch

ref: d952dc074de7640075f05cdca052bd552b9988a4
parent: 183d8b789474ec950364a4fcb34302cbf567718e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Apr 15 08:35:50 EDT 2016

[cc2] Remove references to MEM

At this moment we have only one enum for everything, and we are using the
same character for the input language, for node operation and for symbol
type. This is bullshit. This patch doesn't solve it, but it remove MEM
that was not used. I have to fix this mesh as fast as possible.

--- a/cc2/arch/amd64-sysv/code.c
+++ b/cc2/arch/amd64-sysv/code.c
@@ -91,7 +91,7 @@
 	case OADDR:
 		emittree(np->left);
 		break;
-	case MEM:
+	case OMEM:
 		fputs(symname(np->u.sym), stdout);
 		break;
 	default:
--- a/cc2/arch/i386-sysv/code.c
+++ b/cc2/arch/i386-sysv/code.c
@@ -91,7 +91,7 @@
 	case OADDR:
 		emittree(np->left);
 		break;
-	case MEM:
+	case OMEM:
 		fputs(symname(np->u.sym), stdout);
 		break;
 	default:
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -141,10 +141,10 @@
 	rp = np->right;
 
 	switch (np->op) {
-	case AUTO:
-	case REG:
-	case MEM:
-	case CONST:
+	case OAUTO:
+	case OREG:
+	case OMEM:
+	case OCONST:
 		np->address = 11;
 		break;
 	default:
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -95,7 +95,7 @@
 	case OADDR:
 		emittree(np->left);
 		break;
-	case MEM:
+	case OMEM:
 		fputs(symname(np->u.sym), stdout);
 		break;
 	default:
--- a/cc2/arch/z80/cgen.c
+++ b/cc2/arch/z80/cgen.c
@@ -29,16 +29,16 @@
 	lp = np->left;
 	rp = np->right;
 	switch (np->op) {
-	case AUTO:
+	case OAUTO:
 		np->address = 11;
 		break;
-	case REG:
+	case OREG:
 		np->address = 13;
 		break;
-	case MEM:
+	case OMEM:
 		np->address = 12;
 		break;
-	case CONST:
+	case OCONST:
 		np->address = 20;
 		break;
 	default:
--- a/cc2/arch/z80/code.c
+++ b/cc2/arch/z80/code.c
@@ -117,7 +117,7 @@
 	case OADDR:
 		emittree(np->left);
 		break;
-	case MEM:
+	case OMEM:
 		fputs(symname(np->u.sym), stdout);
 		break;
 	default:
--- a/cc2/code.c
+++ b/cc2/code.c
@@ -38,7 +38,6 @@
 		np->u.i = np->u.i;
 		break;
 	case LABEL:
-	case MEM:
 		addr->u.sym = np->u.sym;
 		break;
 	case AUTO: