scc

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

commit c4db51782e98cba3cd7b4203447db47dca8fa398
parent 14390f9b8e3ae2871b6243adcddbdd3ea01eaf4f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 16 Feb 2015 15:14:21 +0100

Convert code in a wrapper function

code was written only to be sure that the logic in the code generator
was correct, but we can move now to a better base for the code generator,
so we want to store in memory the assembler instruction in an internal
format, and then we will be able to optimize this output later.

Diffstat:
cc2/code.c | 23-----------------------
1 file changed, 0 insertions(+), 23 deletions(-)

diff --git a/cc2/code.c b/cc2/code.c @@ -39,27 +39,4 @@ static char *opfmt[] = { void code(char op, ...) { - va_list va; - char *cp, c; - - va_start(va, op); - for (cp = opfmt[op]; c = *cp; ++cp) { - switch (c) { - case 'o': - fputs(opnames[op], stdout); - break; - case 'r': - fputs(regnames[va_arg(va, int)], stdout); - break; - case 'i': - printf("%d", va_arg(va, int)); - break; - default: - putchar(c); - break; - } - } - putchar('\n'); - - va_end(va); }