diff options
-rw-r--r-- | llvm/include/llvm/IR/CallSite.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/CallSite.h b/llvm/include/llvm/IR/CallSite.h index f8f31f6608e..40784992743 100644 --- a/llvm/include/llvm/IR/CallSite.h +++ b/llvm/include/llvm/IR/CallSite.h @@ -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: |