scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit a4b3b284742d4f7f3cd2fd53a00acff7a8c6a0cf
parent 78f9181916841fb978bf13efb3df7f44eccda367
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 17 Aug 2016 09:36:04 +0200

[cc2-qbe] Add support for NULL parameter in tmpnode()

It is a very common case to call 'newnode(tmpnode(OTMP))'
so it is a good idea to pack it into newnode().

Diffstat:
Mcc2/arch/qbe/cgen.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c @@ -97,6 +97,8 @@ tmpnode(Node *np, Type *tp) { Symbol *sym; + if (!np) + np = newnode(OTMP); sym = getsym(TMPSYM); sym->type = np->type = *tp; sym->kind = STMP;