commit cc2f2844edf910cc11eb0e51ddb47b641dbd2315
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Thu Jun 2 17:26:19 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Thu Jun 2 17:26:19 2016 +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.
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index 5ec388e..4d3660d 100644
--- 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 */