scc

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

commit 980ffdd94c74342d34671b4a383bea0ab9a2430e
parent 162486162929c82a4c92763e7ad488c064d4142c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 18 Apr 2016 17:26:02 +0200

[cc2-qbe] Support void functions in qbe

Qbe functions are indicated omitting the type in the function
declaration. In our case a void type can be discovered seeing
that the size is 0.

Diffstat:
Mcc2/arch/qbe/code.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c @@ -139,6 +139,8 @@ size2asm(Type *tp) return "b"; } else { switch (tp->size) { + case 0: + return ""; case 1: return "b"; case 2: