From a1d8e29851f1440d178fb72adfa99977a3a77dc2 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 22 Dec 2008 22:16:31 +0000 Subject: [PATCH] Simplification: Negate the operator== method instead of implementing a full operator!= method. llvm-svn: 61352 --- lib/Transforms/Scalar/GVN.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index e517b3a5295..aca49ba3c09 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -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); } };