scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 56d9408bb233d616ae03ccd4d3da3e0fe8e5220e
parent dd21e6a1c3601821e00992066fd65b5fe24c0e3f
Author: Quentin Rameau <quinq@fifth.space>
Date:   Fri,  3 Jun 2016 12:47:56 +0200

[cc2] fix qbe call instruction parameters generation

qbe parser doesn't accept newlines in call PARAMS sets.

Diffstat:
Mcc2/arch/qbe/code.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c @@ -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]; @@ -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 @@ -430,7 +430,7 @@ param(void) static void ecall(void) { - puts("\t\t)"); + puts(")"); } static void