summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVN.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-12-22 22:16:31 +0000
committerBill Wendling <isanbard@gmail.com>2008-12-22 22:16:31 +0000
commit86f01cb9f6ff768b1fd3ac00bc5ea8247a06b74c (patch)
tree797241daa818d24355c3d560c46fd32fad1ebbce /llvm/lib/Transforms/Scalar/GVN.cpp
parent2654e18c84182aefdb18a57ec758479fe24f9e7d (diff)
downloadbcm5719-llvm-86f01cb9f6ff768b1fd3ac00bc5ea8247a06b74c.tar.gz
bcm5719-llvm-86f01cb9f6ff768b1fd3ac00bc5ea8247a06b74c.zip
Simplification: Negate the operator== method instead of implementing a full operator!= method.
llvm-svn: 61352
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVN.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index e517b3a5295..aca49ba3c09 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/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);
}
};
OpenPOWER on IntegriCloud