shithub: scc

Download patch

ref: 1e257a4aedd7fe98c0f59750b26807da432d326b
parent: 6624f3b6cd575a670cf4f424e4e93ae8df8a43df
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Apr 18 05:47:22 EDT 2014

Change name of ISNODELOG to ISNODECMP

ISNODELOG stand for "is node logical", but it was not a good
mnemonic. ISNODECMP stands for "is node comparision", and it is
a better mnemonic, but is not true, because it is also true for
logical and and logical or. We are going to use ISNODECMP
because is more legible.

--- a/cc1.h
+++ b/cc1.h
@@ -221,7 +221,7 @@
 #define TYP(s) ((union unode) {.type = s})
 #define ISNODESYM(n) ((n)->code == emitsym)
 #define ISNODEBIN(n) ((n)->code == emitbin)
-#define ISNODELOG(n) (ISNODEBIN(n) && (n)->u.op & 0x40)
+#define ISNODECMP(n) (ISNODEBIN(n) && (n)->u.op & 0x40)
 
 extern Node *expr(void);
 extern void extdecl(void), decl(void), compound(void);
--- a/expr.c
+++ b/expr.c
@@ -241,7 +241,7 @@
 static Node *
 exp2cond(Node *np, char neg)
 {
-	if (ISNODELOG(np)) {
+	if (ISNODECMP(np)) {
 			np->u.op ^= neg;
 			return np;
 	}
@@ -288,7 +288,7 @@
 static Node *
 iszero(Node *np)
 {
-	if (ISNODELOG(np))
+	if (ISNODECMP(np))
 		return np;
 	return compare(ONE, np, constcode(zero));
 }
@@ -296,7 +296,7 @@
 static Node *
 eval(Node *np)
 {
-	if (!ISNODELOG(np))
+	if (!ISNODECMP(np))
 		return np;
 	return ternarycode(np, constcode(one), constcode(zero));
 }