scc

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

commit 9676a1ef385aba1e248f18cd3e6109d392b73815
parent d6ac9cf3eced3e5c60be6d251eb85121f9396cd6
Author: Roberto E. Vargas Caballero <roberto.vargas@igrid-td.com>
Date:   Thu, 31 Mar 2016 18:21:05 +0200

[cc2] Change addnode() to addstmt()

Addnode() was not a good name because it was suggesting that we were adding
the current node to some data structure, but in fact we were adding the
node of the current statement into the function body list.

Diffstat:
cc2/parser.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/cc2/parser.c b/cc2/parser.c @@ -592,11 +592,10 @@ labeldcl( void) nextline(); stmtp->label = sym; sym->u.label = stmtp; - } static void -addnode(Node *np) +addstmt(Node *np) { if (!curfun->u.label) curfun->u.label = np; @@ -616,7 +615,7 @@ stmt(void) deltree(np); return; } - addnode(np); + addstmt(np); } static void @@ -634,7 +633,7 @@ endfun(void) np = newnode(); np->op = ONOP; - addnode(np); + addstmt(np); /* TODO: process the function */ curfun = NULL; funpars = -1;