scc

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

commit d9bbd7ad7628e10d605a7958db16a432164c4a1d
parent 3afef127c2996c8be4c24136f105ddebdbd0a437
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat, 15 Aug 2015 19:55:47 +0200

Move function brackets to a line

This make easier to parse the IR, because there is no difference
between a prototype and a function.

Diffstat:
cc1/code.c | 2+-
cc1/tests/test001.c | 3++-
cc1/tests/test002.c | 3++-
cc1/tests/test003.c | 9++++++---
cc1/tests/test004.c | 3++-
cc1/tests/test005.c | 3++-
cc1/tests/test006.c | 9+++++----
7 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/cc1/code.c b/cc1/code.c @@ -330,7 +330,7 @@ emitfun(unsigned op, void *arg) int n; emitdcl(op, arg); - puts("\t{"); + puts("\n{"); n = sym->type->n.elem; for (sp = sym->u.pars; n-- > 0; ++sp) { diff --git a/cc1/tests/test001.c b/cc1/tests/test001.c @@ -5,7 +5,8 @@ output: F3 P X1 F3 printf F1 -G2 F1 main { +G2 F1 main +{ - X1 "68656C6C6F20776F726C640A aP pP cI yI #I0 diff --git a/cc1/tests/test002.c b/cc1/tests/test002.c @@ -4,7 +4,8 @@ description: Test forward references before definition of types output: G4 P x F1 -G6 F1 main { +G6 F1 main +{ - S2 S ( M5 I i diff --git a/cc1/tests/test003.c b/cc1/tests/test003.c @@ -3,15 +3,18 @@ name: TEST003 description: Select function to call inside ternary operator output: F1 -G1 F1 foo { +G1 F1 foo +{ - yI #I2A } -G2 F1 bar { +G2 F1 bar +{ - yI #I18 } -G3 F1 main { +G3 F1 main +{ - yI G1 cI } diff --git a/cc1/tests/test004.c b/cc1/tests/test004.c @@ -3,7 +3,8 @@ name: TEST004 description: Test integer operations output: F1 -G1 F1 main { +G1 F1 main +{ - A2 I x A2 #I0 :I diff --git a/cc1/tests/test005.c b/cc1/tests/test005.c @@ -3,7 +3,8 @@ name: TEST005 description: Test unary integer operations output: F1 -G1 F1 main { +G1 F1 main +{ - A2 I x A2 #I3 :I diff --git a/cc1/tests/test006.c b/cc1/tests/test006.c @@ -2,12 +2,13 @@ name: TEST006 description: Basic test for if output: -test006.c:41: warning: conditional expression is constant -test006.c:43: warning: conditional expression is constant -test006.c:46: warning: conditional expression is constant +test006.c:42: warning: conditional expression is constant +test006.c:44: warning: conditional expression is constant +test006.c:47: warning: conditional expression is constant G1 M c F1 -G2 F1 main { +G2 F1 main +{ - j L2 #I0 yI #I1