[hackers] [scc] [cc1] Remove nextsym() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 20 Dec 2016 19:26:44 +0100 (CET)

commit d9bc6862e85758294126d8110263115f259f88da
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Dec 20 19:24:00 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Dec 20 19:24:00 2016 +0100

    [cc1] Remove nextsym()
    
    It is not longer needed because we already use another hash
    table for cpp symbols.

diff --git a/cc1/lex.c b/cc1/lex.c
index 6abe262..604fab2 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
_AT_@ -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
index 4384e9c..9568a59 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
_AT_@ -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) {
Received on Tue Dec 20 2016 - 19:26:44 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 20 2016 - 19:36:17 CET