scc

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

commit d9bc6862e85758294126d8110263115f259f88da
parent a06b587d1805b93e880efea3773c084b6111d0c6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 20 Dec 2016 19:24:00 +0100

[cc1] Remove nextsym()

It is not longer needed because we already use another hash
table for cpp symbols.

Diffstat:
Mcc1/lex.c | 6------
Mcc1/symbol.c | 22----------------------
2 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/cc1/lex.c b/cc1/lex.c @@ -499,12 +499,6 @@ iden(void) if ((sym = lookup(NS_CPP, yytext, NOALLOC)) != NULL) { if (!disexpand && expand(begin, sym)) return next(); - /* - * it is not a correct macro call, so try to find - * another definition. - */ - if (lexmode != CPPMODE) - sym = nextsym(sym, namespace); } sym = lookup(namespace, yytext, ALLOC); yylval.sym = sym; diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -277,28 +277,6 @@ lookup(int ns, char *name, int alloc) } Symbol * -nextsym(Symbol *sym, int ns) -{ - char *s, *t, c; - Symbol *p; - - /* - * This function is only called when a macro with parameters - * is called without them. - * #define x(y) ((y) + 1) - * int x = x(y); - */ - s = sym->name; - c = *s; - for (p = sym->hash; p; p = p->hash) { - t = p->name; - if (c == *t && !strcmp(s, t)) - return p; - } - return allocsym(ns, s); -} - -Symbol * install(int ns, Symbol *sym) { if (sym->flags & SDECLARED) {