scc

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

commit eda760b338438afdf9f20d30be45b04042daa74e
parent 2a651a1e594d8805e6873e45a72aa73ddb6bb505
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 10 Jul 2014 14:55:30 +0200

Remove emitsframe

This function only printed a '{' and the idea was make a bit easier
the parsing of intermediate language, but it was a bit stupid idea.

Diffstat:
Mcc1/cc1.h | 2+-
Mcc1/code.c | 14+++++---------
Mcc1/decl.c | 3+--
3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/cc1/cc1.h b/cc1/cc1.h @@ -199,7 +199,7 @@ enum { }; extern void - emitdcl(Symbol *), emitsframe(Symbol *), emiteframe(void), + emitdcl(Symbol *), emitefun(void), emitsym(Node *), emitunary(Node *), emitbin(Node *), emitexp(Node *), emitprint(Node *), emitlabel(Symbol *), emitjump(Symbol *, Node *), diff --git a/cc1/code.c b/cc1/code.c @@ -190,18 +190,14 @@ emitprint(Node *np) void emitfun(Symbol *sym) { - printf("%c%d\tn%s\n", - sym->s.isglobal ? 'X' : 'Y', sym->id, sym->name); + printf("%c%d\tn%s%s\n", + sym->s.isglobal ? 'X' : 'Y', + sym->id, sym->name, + sym->s.isdefined ? "\t{" : ""); } void -emitsframe(Symbol *sym) -{ - puts("{"); -} - -void -emiteframe(void) +emitefun(void) { puts("}"); } diff --git a/cc1/decl.c b/cc1/decl.c @@ -474,9 +474,8 @@ extdecl(void) } else if (yytoken == '{') { curfun = sym; emitfun(sym); - emitsframe(sym); context(NULL, NULL, NULL); - emiteframe(); + emitefun(); return; } } while (accept(','));