scc

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

commit cc2f2844edf910cc11eb0e51ddb47b641dbd2315
parent dd20c9cb3f57b3af3bc1f6ecc088fdb214fdd4f8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu,  2 Jun 2016 17:26:19 +0200

[cc2-qbe] Do not emit local types

Local types are represented by local symbols,
and in writeout we were writing all the local
symbols that we had, including the types.
Types has no kind (or class storage), so we can
detect them checking that we have some kind in
the symbol.

Diffstat:
cc2/arch/qbe/code.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c @@ -328,7 +328,7 @@ writeout(void) /* allocate stack space for local variables) */ for ( ; p && p->id != TMPSYM; p = p->next) { - if (p->kind != SLABEL) + if (p->kind && p->kind != SLABEL) alloc(p); } /* store formal parameters in parameters */