[hackers] [scc] [cc2] fix qbe call instruction parameters generation || Quentin Rameau

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

commit 56d9408bb233d616ae03ccd4d3da3e0fe8e5220e
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Fri Jun 3 12:47:56 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Fri Jun 3 12:47:56 2016 +0200

    [cc2] fix qbe call instruction parameters generation
    
    qbe parser doesn't accept newlines in call PARAMS sets.

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index 4d3660d..7808f30 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
_AT_@ -133,8 +133,8 @@ static struct opdata {
         [ASCALLL] = {.fun = call, .letter = 'l'},
         [ASCALLD] = {.fun = call, .letter = 'd'},
         [ASCALL] = {.fun = ecall},
- [ASPAR] = {.fun = param, .txt = "\t\t%s %s,\n"},
- [ASPARE] = {.fun = param, .txt = "\t\t%s %s\n"},
+ [ASPAR] = {.fun = param, .txt = "%s %s, "},
+ [ASPARE] = {.fun = param, .txt = "%s %s"},
 };
 
 static char buff[ADDR_LEN];
_AT_@ -415,7 +415,7 @@ call(void)
 
        strcpy(to, addr2txt(&pc->to));
        strcpy(from, addr2txt(&pc->from1));
- printf("\t%s =%c\tcall\t%s(\n", to, p->letter, from);
+ printf("\t%s =%c\tcall\t%s(", to, p->letter, from);
 }
 
 static void
_AT_@ -430,7 +430,7 @@ param(void)
 static void
 ecall(void)
 {
- puts("\t\t)");
+ puts(")");
 }
 
 static void
Received on Fri Jun 03 2016 - 12:50:54 CEST

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