From caebbc3ee1071ace94003cdf645f749d2b0a9eed Mon Sep 17 00:00:00 2001 From: grischka Date: Thu, 5 May 2016 10:39:09 +0200 Subject: tccgen: scope levels for local symbols ... for fast redeclaration checks Also, check function parameters too: void foo(int a) { int a; ... } Also, try to fix struct/union/enum's on different scopes: { struct xxx { int x; }; { struct xxx { int y; }; ... }} and some (probably not all) combination with incomplete declarations "struct xxx;" Replaces 2bfedb18675228c3837c23fa523231f55e102c12 and 07d896c8e5d1b46bf4aebd403c78e5f7ffebe02a Fixes cf95ac399cbce1ea8a519f91dd36a5cfd4ea7943 --- tcc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index aec80b8..c5cf990 100644 --- a/tcc.h +++ b/tcc.h @@ -459,7 +459,10 @@ typedef struct AttributeDef { /* symbol management */ typedef struct Sym { int v; /* symbol token */ - int asm_label; /* associated asm label */ + union { + int asm_label; /* associated asm label */ + int scope; /* scope level for locals */ + }; union { long r; /* associated register */ struct Attribute a; @@ -707,7 +710,6 @@ struct TCCState { Liuux 2.4.26 can't find initrd when compiled with a new algorithm */ int dollars_in_identifiers; /* allows '$' char in indentifiers */ int normalize_inc_dirs; /* remove non-existent or duplicate directories from include paths */ - int no_type_redef_check; /* no local vars redefinition check */ /* warning switches */ int warn_write_strings; -- cgit v1.3.1