scc

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

commit 677232c01056366ed709373ebe020f2add080136
parent 36efc76de7867528cd04d01e3265ff8a61d1f4df
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 19 Jul 2015 22:17:04 +0200

Remove @ statements

This was a hack that allowed me to use cc1 as frontend for a
C interpreter. This is not needed anymore?

Diffstat:
Mcc1/cc1.h | 1-
Mcc1/code.c | 12------------
Mcc1/stmt.c | 5-----
3 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/cc1/cc1.h b/cc1/cc1.h @@ -254,7 +254,6 @@ enum { OESTRUCT, OELOOP, OBLOOP, - OPRINT, OFUN, ORET, ODECL, diff --git a/cc1/code.c b/cc1/code.c @@ -120,7 +120,6 @@ void (*opcode[])(unsigned, void *) = { [OESTRUCT] = emittext, [OELOOP] = emittext, [OBLOOP] = emittext, - [OPRINT] = emitprint, [OFUN] = emitfun, [ORET] = emitret, [ODECL] = emitdcl, @@ -253,17 +252,6 @@ emitexp(unsigned op, void *arg) } static void -emitprint(unsigned op, void *arg) -{ - Node *np = arg; - - emitnode(np); - printf("\tk%c\n", np->type->letter); - fflush(stdout); - freetree(np); -} - -static void emitfun(unsigned op, void *arg) { Symbol *sym = arg; diff --git a/cc1/stmt.c b/cc1/stmt.c @@ -353,11 +353,6 @@ stmt(Symbol *lbreak, Symbol *lcont, Caselist *lswitch) case IDEN: fun = (ahead() == ':') ? Label : stmtexp; break; - case '@': - next(); - np = expr(); - emit(OPRINT, np); - return; } (*fun)(lbreak, lcont, lswitch); }