scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 78517784dbcc4232bdd71df3365437b6174ab717
parent 51d0b0427379342a3b2d3701c495bd87b3bea8b1
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 18 Sep 2015 12:34:34 +0200

Avoid emit castings to void

These castings are only important to semantic level, so it is a non
sense to emit them to the backend.

Diffstat:
Mcc1/code.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cc1/code.c b/cc1/code.c @@ -318,7 +318,8 @@ emitcast(unsigned op, void *arg) Node *np = arg, *lp = np->left; emitnode(lp); - printf("\t%c%c", lp->type->letter, np->type->letter); + if (np->type != voidtype) + printf("\t%c%c", lp->type->letter, np->type->letter); } static void