[llvm-commits] [llvm] r61352 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Bill Wendling
isanbard at gmail.com
Mon Dec 22 14:16:32 PST 2008
Author: void
Date: Mon Dec 22 16:16:31 2008
New Revision: 61352
URL: http://llvm.org/viewvc/llvm-project?rev=61352&view=rev
Log:
Simplification: Negate the operator== method instead of implementing a full operator!= method.
Modified:
llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=61352&r1=61351&r2=61352&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon Dec 22 16:16:31 2008
@@ -110,30 +110,7 @@
}
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);
}
};
More information about the llvm-commits
mailing list