OSDN Git Service

[ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)
authorTeresa Johnson <tejohnson@google.com>
Wed, 6 Jun 2018 18:32:16 +0000 (18:32 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 6 Jun 2018 18:32:16 +0000 (18:32 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334111 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/ModuleSummaryIndex.h

index 8c858fc..3ea2256 100644 (file)
@@ -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) {