forked from OSchip/llvm-project
[IR] Add DenseMapInfo<CallSite>.
Summary: A CallSite is basically an Instruction*, and you can put Instruction*s into DenseMaps, so you should be able to do the same with CallSites. This is used in a later patch. Reviewers: timshen Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25643 llvm-svn: 284870
This commit is contained in:
parent
6f72737c3b
commit
245c3e75cd
|
@ -623,9 +623,31 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
friend struct DenseMapInfo<CallSite>;
|
||||
User::op_iterator getCallee() const;
|
||||
};
|
||||
|
||||
template <> struct DenseMapInfo<CallSite> {
|
||||
using BaseInfo = llvm::DenseMapInfo<decltype(CallSite::I)>;
|
||||
|
||||
static CallSite getEmptyKey() {
|
||||
CallSite CS;
|
||||
CS.I = BaseInfo::getEmptyKey();
|
||||
return CS;
|
||||
}
|
||||
static CallSite getTombstoneKey() {
|
||||
CallSite CS;
|
||||
CS.I = BaseInfo::getTombstoneKey();
|
||||
return CS;
|
||||
}
|
||||
static unsigned getHashValue(const CallSite &CS) {
|
||||
return BaseInfo::getHashValue(CS.I);
|
||||
}
|
||||
static bool isEqual(const CallSite &LHS, const CallSite &RHS) {
|
||||
return LHS == RHS;
|
||||
}
|
||||
};
|
||||
|
||||
/// ImmutableCallSite - establish a view to a call site for examination
|
||||
class ImmutableCallSite : public CallSiteBase<> {
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue