shithub: scc

Download patch

ref: ae0f567bba4dd727c7f2f72764b04e9540c36850
parent: b54555847db093e24321a8d628e9a2f0f3fdb888
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Sep 24 18:27:10 EDT 2015

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.

--- a/cc1/code.c
+++ b/cc1/code.c
@@ -23,8 +23,8 @@
 	[OADD] = "+",
 	[OSUB] = "-",
 	[OMUL] = "*",
-	[OINC] = ";+",
-	[ODEC] =  ";-",
+	[OINC] = ":i",
+	[ODEC] =  ":d",
 	[OPTR] = "@",
 	[OMOD] = "%",
 	[ODIV] = "/",
@@ -64,7 +64,7 @@
 	[OBRANCH] = "\tj\tL%d",
 	[OEFUN] = "}\n",
 	[OELOOP] = "\tb\n",
-	[OBLOOP] = "\td\n",
+	[OBLOOP] = "\te\n",
 	[ORET] = "\tr",
 	[OPAR] = "p",
 	[OCALL] = "c",
--- a/cc1/ir.md
+++ b/cc1/ir.md
@@ -176,8 +176,8 @@
 * :& -- 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 @@
 of a loop:
 
 * b -- begin of loop
-* d -- end of loop
+* e -- end of loop
 
 #### Switch statement ####