[llvm] r334111 - [ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 6 11:32:16 PDT 2018
Author: tejohnson
Date: Wed Jun 6 11:32:16 2018
New Revision: 334111
URL: http://llvm.org/viewvc/llvm-project?rev=334111&view=rev
Log:
[ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)
Compare Ref pointers instead of GUID, to handle comparison with special
empty/tombstone ValueInfo. This was already done for operator==, to
support inserting ValueInfo into DenseMap, but I need the operator!=
side change for upcoming AsmParser summary parsing support.
Modified:
llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
Modified: llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h?rev=334111&r1=334110&r2=334111&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h (original)
+++ llvm/trunk/include/llvm/IR/ModuleSummaryIndex.h Wed Jun 6 11:32:16 2018
@@ -179,14 +179,14 @@ struct ValueInfo {
inline bool operator==(const ValueInfo &A, const ValueInfo &B) {
assert(A.getRef() && B.getRef() &&
- "Need ValueInfo with non-null Ref to compare GUIDs");
+ "Need ValueInfo with non-null Ref for comparison");
return A.getRef() == B.getRef();
}
inline bool operator!=(const ValueInfo &A, const ValueInfo &B) {
assert(A.getRef() && B.getRef() &&
- "Need ValueInfo with non-null Ref to compare GUIDs");
- return A.getGUID() != B.getGUID();
+ "Need ValueInfo with non-null Ref for comparison");
+ return A.getRef() != B.getRef();
}
inline bool operator<(const ValueInfo &A, const ValueInfo &B) {
More information about the llvm-commits
mailing list