scc

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

commit e0eed9f03d22464740c57d5baea245791ef84f23
parent b6847c53e54893f2f3808ff0582cb675c0497528
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 26 May 2015 09:36:06 +0200

Do not reserve identifiers for cpp symbols

Preprocessor symbols are not going to be emited ever,
so it is not a good idea to reserve identifiers that
only are going to generate holes in the symbol table
of the backend.

Diffstat:
cc1/symbol.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -88,8 +88,8 @@ newsym(unsigned ns) Symbol *sym; sym = malloc(sizeof(*sym)); - sym->ns = ns; - sym->id = (curctx) ? ++localcnt : ++globalcnt; + if ((sym->ns = ns) != NS_CPP) + sym->id = (curctx) ? ++localcnt : ++globalcnt; sym->ctx = curctx; sym->token = IDEN; sym->flags = ISDEFINED;