[hackers] [scc] [cc2-qbe] Support void functions in qbe || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 18 Apr 2016 17:27:10 +0200 (CEST)

commit 980ffdd94c74342d34671b4a383bea0ab9a2430e
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Apr 18 17:26:02 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Mon Apr 18 17:26:02 2016 +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.

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index fbac10f..a4e619d 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
_AT_@ -139,6 +139,8 @@ size2asm(Type *tp)
                 return "b";
         } else {
                 switch (tp->size) {
+ case 0:
+ return "";
                 case 1:
                         return "b";
                 case 2:
Received on Mon Apr 18 2016 - 17:27:10 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 18 2016 - 17:36:16 CEST