scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 5a9c8fe5457c845a087e7c1e18f44ed5d3961095
parent 738b9039885749efe856cc34db6b80d44e927a65
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 15 Apr 2016 12:35:50 +0200

[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.

Diffstat:
cc2/arch/amd64-sysv/code.c | 2+-
cc2/arch/i386-sysv/code.c | 2+-
cc2/arch/qbe/cgen.c | 8++++----
cc2/arch/qbe/code.c | 2+-
cc2/arch/z80/cgen.c | 8++++----
cc2/arch/z80/code.c | 2+-
cc2/code.c | 1-
7 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/cc2/arch/amd64-sysv/code.c b/cc2/arch/amd64-sysv/code.c @@ -91,7 +91,7 @@ emittree(Node *np) case OADDR: emittree(np->left); break; - case MEM: + case OMEM: fputs(symname(np->u.sym), stdout); break; default: diff --git a/cc2/arch/i386-sysv/code.c b/cc2/arch/i386-sysv/code.c @@ -91,7 +91,7 @@ emittree(Node *np) case OADDR: emittree(np->left); break; - case MEM: + case OMEM: fputs(symname(np->u.sym), stdout); break; default: diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c @@ -141,10 +141,10 @@ sethi(Node *np) 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: diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c @@ -95,7 +95,7 @@ emittree(Node *np) case OADDR: emittree(np->left); break; - case MEM: + case OMEM: fputs(symname(np->u.sym), stdout); break; default: diff --git a/cc2/arch/z80/cgen.c b/cc2/arch/z80/cgen.c @@ -29,16 +29,16 @@ sethi(Node *np) 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: diff --git a/cc2/arch/z80/code.c b/cc2/arch/z80/code.c @@ -117,7 +117,7 @@ emittree(Node *np) case OADDR: emittree(np->left); break; - case MEM: + case OMEM: fputs(symname(np->u.sym), stdout); break; default: diff --git a/cc2/code.c b/cc2/code.c @@ -38,7 +38,6 @@ addr(int op, Node *np, Addr *addr) np->u.i = np->u.i; break; case LABEL: - case MEM: addr->u.sym = np->u.sym; break; case AUTO: