scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 1e62acd8544247089ee9d0102ec2da973e57135a
parent 51d7f27d9dbda8d2dad833f985a6ef28bee4a939
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  3 Jun 2016 12:55:57 +0200

Merge remote-tracking branch 'origin/master'

Diffstat:
cc2/arch/qbe/code.c | 8++++----
driver/posix/scc.c | 2++
2 files changed, 6 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]; @@ -417,7 +417,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 @@ -432,7 +432,7 @@ param(void) static void ecall(void) { - puts("\t\t)"); + puts(")"); } static void diff --git a/driver/posix/scc.c b/driver/posix/scc.c @@ -217,6 +217,8 @@ toolfor(char *file) if (dot) { if (!strcmp(dot, ".c")) return CC1; + if (!strcmp(dot, ".ir")) + return CC2; if (!strcmp(dot, ".qbe")) return QBE; if (!strcmp(dot, ".as"))