scc

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

commit 74fc24f79803f1e36e99da05f19e70a2d588cfa9
parent b29bf1f729a168c028821069ea4bb46000c82f96
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 31 May 2016 09:12:20 +0200

[cc2-qbe] Add support for void functions

Void functions are dealt as int functions which return a
value which will not be used.

Diffstat:
cc2/arch/qbe/cgen.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c @@ -243,6 +243,10 @@ call(Node *np) pars[n] = cgen(p->left); switch (tp->size) { + case 0: + np->left = tmpnode(newnode(OTMP)); + op = ASCALLW; + break; case 1: op = ASCALLB; break;