Simplification: Negate the operator== method instead of implementing a full operator...
authorBill Wendling <isanbard@gmail.com>
Mon, 22 Dec 2008 22:16:31 +0000 (22:16 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 22 Dec 2008 22:16:31 +0000 (22:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61352 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index e517b3a52954e7d0cac920328fa87d2acd48ed0c..aca49ba3c096a86d14137b65aec92a745370e39d 100644 (file)
@@ -110,30 +110,7 @@ namespace {
     }
   
     bool operator!=(const Expression &other) const {
-      if (opcode != other.opcode)
-        return true;
-      else if (opcode == EMPTY || opcode == TOMBSTONE)
-        return false;
-      else if (type != other.type)
-        return true;
-      else if (function != other.function)
-        return true;
-      else if (firstVN != other.firstVN)
-        return true;
-      else if (secondVN != other.secondVN)
-        return true;
-      else if (thirdVN != other.thirdVN)
-        return true;
-      else {
-        if (varargs.size() != other.varargs.size())
-          return true;
-      
-        for (size_t i = 0; i < varargs.size(); ++i)
-          if (varargs[i] != other.varargs[i])
-            return true;
-    
-          return false;
-      }
+      return !(*this == other);
     }
   };