shithub: scc

Download patch

ref: 9aed480a63f3691b3056e77b11830b9c894ffe59
parent: a63dd7c3e1fe8e41223a178f0b38a3354bd34d5e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Aug 12 10:47:36 EDT 2016

[cc2-qbe] Add support for logic negation operator

This operator is very easy because we only have
to change what is the true and what is the false.

--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -187,6 +187,9 @@
 	Symbol *label;
 
 	switch (np->op) {
+	case ONEG:
+		bool(l, false, true);
+		break;
 	case OAND:
 		label = newlabel();
 		bool(l, label, true);
@@ -255,6 +258,7 @@
 	case OMEM:
 	case OAUTO:
 		return load(np, ret);
+	case ONEG:
 	case OAND:
 	case OOR:
 		true = newlabel();