[hackers] [scc] [cc2-qbe] Convert register variables into automatic variables || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 3 Jun 2016 12:56:07 +0200 (CEST)

commit 88ae3bed3e7c06774ab9a9a98db4a71534fea594
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jun 3 12:53:51 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Jun 3 12:53:51 2016 +0200

    [cc2-qbe] Convert register variables into automatic variables
    
    Qbe ignores register variables, and this change makes easier
    for qbe backend to handle automatic and register variables.

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index 4d3660d..c637ced 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
_AT_@ -282,6 +282,8 @@ defpar(Symbol *sym)
 void
 defvar(Symbol *sym)
 {
+ if (sym->kind == SREG)
+ sym->kind = SAUTO;
 }
 
 void
Received on Fri Jun 03 2016 - 12:56:07 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 03 2016 - 13:00:21 CEST