scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 77a650bcc7e50297ceacee29cbf26292d13faf7b
parent c73f4071591a3c11ae68f082d751e957e39c14fb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 11 Dec 2024 10:53:32 +0100

cc2/qbe: Move statement ops to cgen()

It makes easier to understand what are the node ops that can define
a new statement.

Diffstat:
Msrc/cmd/scc-cc/cc2/qbe/cgen.c | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/cmd/scc-cc/cc2/qbe/cgen.c b/src/cmd/scc-cc/cc2/qbe/cgen.c @@ -643,13 +643,6 @@ rhs(Node *np) tp = &np->type; switch (np->op) { - case OBFUN: - return function(); - case ONOP: - case OBLOOP: - case OELOOP: - case OEFUN: - return NULL; case OTMP: case OCONST: return np; @@ -762,6 +755,13 @@ cgen(Node *np) setlabel(np->label); switch (np->op) { + case OBFUN: + return function(); + case ONOP: + case OBLOOP: + case OELOOP: + case OEFUN: + break; case OJMP: label2node(&aux, np->u.sym); code(ASJMP, NULL, &aux, NULL);