[hackers] [scc/qbe] [cc2-qbe] move the call to setlabel() to cgen() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 12 Aug 2016 11:18:01 +0200 (CEST)

commit b5d5fce67e0924acced64ca3b4542a238ea1c678
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Aug 12 11:06:51 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Aug 12 11:06:51 2016 +0200

    [cc2-qbe] move the call to setlabel() to cgen()
    
    Cgen() is the function called to generate the asm code
    for a C statement, and it means that it will receive the node
    which has the label.

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 4f94dde..e360c77 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
_AT_@ -241,7 +241,6 @@ rhs(Node *np, Node *ret)
         char *tbl;
         Symbol *true, *false;
 
- setlabel(np->label);
         tp = &np->type;
 
         switch (np->op) {
_AT_@ -323,6 +322,7 @@ cgen(Node *np)
         Node n, *aux, *next, *ifyes, *ifno;
         Symbol *label1, *label2;
 
+ setlabel(np->label);
         switch (np->op) {
         case OJMP:
                 ifyes = label2node(np->u.sym);
Received on Fri Aug 12 2016 - 11:18:01 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 12 2016 - 11:24:21 CEST