scc

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

commit ae0f567bba4dd727c7f2f72764b04e9540c36850
parent b54555847db093e24321a8d628e9a2f0f3fdb888
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 24 Sep 2015 22:27:10 +0200

Join ':' and ';' IR operators

These operators can be joined because at the end in both
cases you have an assignation, so if we join them it is
easier to generate a SSA alike representation.

Diffstat:
Mcc1/code.c | 6+++---
Mcc1/ir.md | 6+++---
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cc1/code.c b/cc1/code.c @@ -23,8 +23,8 @@ char *optxt[] = { [OADD] = "+", [OSUB] = "-", [OMUL] = "*", - [OINC] = ";+", - [ODEC] = ";-", + [OINC] = ":i", + [ODEC] = ":d", [OPTR] = "@", [OMOD] = "%", [ODIV] = "/", @@ -64,7 +64,7 @@ char *optxt[] = { [OBRANCH] = "\tj\tL%d", [OEFUN] = "}\n", [OELOOP] = "\tb\n", - [OBLOOP] = "\td\n", + [OBLOOP] = "\te\n", [ORET] = "\tr", [OPAR] = "p", [OCALL] = "c", diff --git a/cc1/ir.md b/cc1/ir.md @@ -176,8 +176,8 @@ Assignation has some suboperators: * :& -- bitwise and and assign * :^ -- bitwise xor and assign * :| -- bitwise or and assign -* ;+ -- post increment -* ;- -- post decrement +* :i -- post increment +* :d -- post decrement Every operator in an expression has a type descriptor. @@ -267,7 +267,7 @@ to the backend that the next statements are part of the body of a loop: * b -- begin of loop -* d -- end of loop +* e -- end of loop #### Switch statement ####