shithub: scc

Download patch

ref: 6b19e590b87ade3cb94f1e336c894f039ad4a8e0
parent: 2a064a18aa7bf944926109070f6f9eb60e361cf6
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Aug 17 05:36:04 EDT 2016

[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().

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