commit 6a1d5b045462b11e22110e26b220c9ab76e2958c
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Fri Aug 12 14:47:36 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Fri Aug 12 14:47:36 2016 +0200
[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.
diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index f06b9db..e03609c 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -187,6 +187,9 @@ bool(Node *np, Symbol *true, Symbol *false)
Symbol *label;
switch (np->op) {
+ case ONEG:
+ bool(l, false, true);
+ break;
case OAND:
label = newlabel();
bool(l, label, true);
@@ -255,6 +258,7 @@ rhs(Node *np, Node *ret)
case OMEM:
case OAUTO:
return load(np, ret);
+ case ONEG:
case OAND:
case OOR:
true = newlabel();