From 4887adf1907b7bd005fa5e5e57f35bd1a32422a5 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Thu, 30 Apr 2015 16:15:07 +0000 Subject: [PATCH] Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236237 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/AliasAnalysis.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h index 6999bd1a029..ac9d21c590a 100644 --- a/include/llvm/Analysis/AliasAnalysis.h +++ b/include/llvm/Analysis/AliasAnalysis.h @@ -134,6 +134,10 @@ public: Copy.AATags = AAMDNodes(); return Copy; } + + bool operator==(const AliasAnalysis::Location &Other) const { + return Ptr == Other.Ptr && Size == Other.Size && AATags == Other.AATags; + } }; /// getLocation - Fill in Loc with information about the memory reference by @@ -615,9 +619,7 @@ struct DenseMapInfo { } static bool isEqual(const AliasAnalysis::Location &LHS, const AliasAnalysis::Location &RHS) { - return LHS.Ptr == RHS.Ptr && - LHS.Size == RHS.Size && - LHS.AATags == RHS.AATags; + return LHS == RHS; } };