[hackers] [scc] [cc2-qbe] Add support for void functions || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 31 May 2016 09:14:08 +0200 (CEST)

commit 74fc24f79803f1e36e99da05f19e70a2d588cfa9
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue May 31 09:12:20 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
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
_AT_@ -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;
Received on Tue May 31 2016 - 09:14:08 CEST

This archive was generated by hypermail 2.3.0 : Tue May 31 2016 - 09:24:14 CEST