shithub: scc

Download patch

ref: da8a014ccd89acf7d31ea34af8016de61126a446
parent: 1c93045ca831a57e47da5ed0c513b1fc987de308
parent: 680f6e2dab5e05ccc2726a0bb5cc2b4ad2425903
author: Roberto E. Vargas Caballero <[email protected]>
date: Mon Aug 24 16:50:55 EDT 2015

Merge remote-tracking branch 'origin/master'

--- a/cc1/ir.md
+++ b/cc1/ir.md
@@ -18,12 +18,12 @@
 * C -- char
 * I -- int
 * W -- long
-* Q -- long long
+* O -- long long
 * M -- unsigned char
 * N -- unsigned int
 * Z -- unsigned long
 * Q -- unsigned long long
-* O -- void
+* 0 -- void
 * P -- pointer
 * F -- function
 * V -- vector
@@ -31,8 +31,8 @@
 * S -- struct
 * B -- bool
 * J -- float
-* D -- Double
-* H -- double
+* D -- double
+* H -- long double
 
 This list is built for the original Z80 backend, where 'int'
 had the same size than 'short'. Several types need an identifier
@@ -99,14 +99,15 @@
 > X6	F3	printf
 
 After the type specification of the function (F and an identifier),
-is described the type of all the parameters of the function.
+the types of the function parameters are described.
 A '{' in the first column begins the body for the previously
 declared function: For example:
 
-> int printf(char *p) {}
+> int printf(char *cmd) {}
 
 will generate
 
+> F3	P
 > G6	F3	printf
 > {
 > A7	P	cmd
@@ -117,10 +118,11 @@
 declaration of a function. The character '-' marks the separation
 between parameters and local variables:
 
-> int printf(register char *p) {int i;};
+> int printf(register char *cmd) {int i;};
 
 will generate
 
+> F3	P
 > G6	F3	printf
 > {
 > R7	P	cmd
@@ -181,8 +183,16 @@
 * ;+ -- post increment
 * ;- -- post decrement
 
-Every operator in an expression has a type descriptor. Example:
+Every operator in an expression has a type descriptor.
 
+#### Constants ####
+
+Constants are introduced by the character '#'. For example 10 is
+translated to #IA (all the constants are emitted in hexadecimal),
+where I indicates that is an integer constant. Strings represent
+a special case because they are represented with the " character.
+The constant "hello" is emiited as "68656C6C6F. Example:
+
 > int
 > main(void)
 > {
@@ -205,14 +215,6 @@
 two type descriptors together. For example a cast from char to int
 is indicated with CI.
 
-#### Constants ####
-
-constants are introduced by the character '#'. For example 10 is
-translated to #IA (all the constant are emitted in hexadecimal),
-where I indicates that is an integer constant. Strings represent
-a special case because they are represented with the " character.
-The constant "hello" is emiited as "68656C6C6F,
-
 ### Statements ###
 #### Jumps #####
 
@@ -222,13 +224,13 @@
 
 the optional expression field indicates some condition which
 must be satisfied to jump. Example:
-> 
+
 > int
 > main(void)
 > {
 > 	int i;
 > 	goto    label;
-> label:  i -= i;;
+> label:  i -= i;
 > }
 
 generates:
@@ -244,7 +246,8 @@
 > }
 
 Another form of jump is the return statement, which uses the
-letter 'y' and an optional expression. For example:
+letter 'y' with a return type and an optional expression.
+For example:
 
 > int
 > main(void)
@@ -273,11 +276,11 @@
 
 #### Switch statement ####
 
-Switches are represented using a table, where it is indicated
-the label where jump for every case. Common cases are represented
-by 'v', meanwhile default is represented by 'f'. The switch
-statement itself is represented is represented by 's' followed
-by the label where the jump table is located and the expression
+Switches are represented using a table, in which the labels
+where to jump for each case are indicated. Common cases are
+represented by 'v', meanwhile default is represented by 'f'.
+The switch statement itself is represented by 's' followed by
+the label where the jump table is located, and the expression
 of the switch. For example:
 
 > int
@@ -325,12 +328,12 @@
 * C -- char
 * I -- int
 * W -- long
-* Q -- long long
+* O -- long long
 * M -- unsigned char
 * N -- unsigned int
 * Z -- unsigned long
 * Q -- unsigned long long
-* O -- void
+* 0 -- void
 * P -- pointer
 * F -- function
 * V -- vector
@@ -338,8 +341,8 @@
 * S -- struct
 * B -- bool
 * J -- float
-* D -- Double
-* H -- double
+* D -- double
+* H -- long double
 * A -- automatic
 * R -- register
 * G -- public (global variable declared in the module)