commit 74fc24f79803f1e36e99da05f19e70a2d588cfa9
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Tue May 31 09:12:20 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Tue May 31 09:12:20 2016 +0200
[cc2-qbe] Add support for void functions
Void functions are dealt as int functions which return a
value which will not be used.
diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 200c22e..77bb776 100644
--- 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;