Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps

llvm-svn: 236237
This commit is contained in:
Daniel Berlin 2015-04-30 16:15:07 +00:00
parent 8f34134ce9
commit da23c0fde0
1 changed files with 5 additions and 3 deletions

View File

@ -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<AliasAnalysis::Location> {
}
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;
}
};