aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2016-05-04 17:17:51 +0300
committerseyko <seyko2@gmail.com>2016-05-04 17:17:51 +0300
commit2bfedb18675228c3837c23fa523231f55e102c12 (patch)
tree87f6923b0b703b71d658fec261ecd51a8964ce54 /tccgen.c
parent78e4ee55b7243e856ad4257bd44564fd6a95bf91 (diff)
downloadtinycc-2bfedb18675228c3837c23fa523231f55e102c12.tar.gz
tinycc-2bfedb18675228c3837c23fa523231f55e102c12.tar.bz2
-fno-type-redefinition-check
don't catch redefinition for local vars. With this option on tcc accepts the following code: int main() { int a = 0; long a = 0; } But if you shure there is no problem with your local variables, then a compilation speed can be improved if you have a lots of the local variables (50000+)
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tccgen.c b/tccgen.c
index b9681df..898856c 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -166,11 +166,13 @@ ST_INLN void sym_free(Sym *sym)
ST_FUNC Sym *sym_push2(Sym **ps, int v, int t, long c)
{
Sym *s;
- if (ps == &local_stack) {
- for (s = *ps; s && s != scope_stack_bottom; s = s->prev)
- if (!(v & SYM_FIELD) && (v & ~SYM_STRUCT) < SYM_FIRST_ANOM && s->v == v)
- tcc_error("incompatible types for redefinition of '%s'",
- get_tok_str(v, NULL));
+ if (!tcc_state->no_type_redef_check) {
+ if (ps == &local_stack) {
+ for (s = *ps; s && s != scope_stack_bottom; s = s->prev)
+ if (!(v & SYM_FIELD) && (v & ~SYM_STRUCT) < SYM_FIRST_ANOM && s->v == v)
+ tcc_error("incompatible types for redefinition of '%s'",
+ get_tok_str(v, NULL));
+ }
}
s = sym_malloc();
s->asm_label = 0;