[hackers] [scc] [cc1] Do not create id for cpp symbols || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 19 Dec 2016 13:12:39 +0100 (CET)

commit 668cf8197fe0249df975adfae16d2df56f2cc696
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Dec 19 12:27:24 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Dec 19 12:27:24 2016 +0100

    [cc1] Do not create id for cpp symbols
    
    CPP symbols are not going to be emitted ever, so it is
    stupid to create identifiers for them.

diff --git a/cc1/symbol.c b/cc1/symbol.c
index 8a22e95..76097b0 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
_AT_@ -127,6 +127,8 @@ newid(void)
 {
         unsigned short id;
 
+ if (lexmode == CPPMODE)
+ return 0;
         id = ++counterid;
         if (id == 0) {
                 die("Overflow in %s identifiers",
_AT_@ -219,11 +221,9 @@ newstring(char *s, size_t len)
 {
         Symbol *sym = newsym(NS_IDEN);
 
- if (lexmode != CPPMODE) {
+ if (lexmode != CPPMODE)
                 sym->type = mktype(chartype, ARY, len, NULL);
- sym->id = newid();
- }
-
+ sym->id = newid();
         sym->flags |= SSTRING | SCONSTANT | SPRIVATE;
         sym->u.s = xmalloc(len);
         if (s)
Received on Mon Dec 19 2016 - 13:12:39 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 19 2016 - 13:24:18 CET