diff options
Diffstat (limited to 'llvm/lib/VMCore/DebugLoc.cpp')
-rw-r--r-- | llvm/lib/VMCore/DebugLoc.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/DebugLoc.cpp b/llvm/lib/VMCore/DebugLoc.cpp index f8b45eed0d5..cb077cb4374 100644 --- a/llvm/lib/VMCore/DebugLoc.cpp +++ b/llvm/lib/VMCore/DebugLoc.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/DebugLoc.h" +#include "llvm/ADT/DenseMapInfo.h" #include "LLVMContextImpl.h" using namespace llvm; @@ -128,6 +129,29 @@ DebugLoc DebugLoc::getFromDILocation(MDNode *N) { } //===----------------------------------------------------------------------===// +// DenseMap specialization +//===----------------------------------------------------------------------===// + +DebugLoc DenseMapInfo<DebugLoc>::getEmptyKey() { + return DebugLoc(); +} + +DebugLoc DenseMapInfo<DebugLoc>::getTombstoneKey() { + return DebugLoc::getTombstoneKey(); +} + +unsigned DenseMapInfo<DebugLoc>::getHashValue(const DebugLoc &Key) { + FoldingSetNodeID ID; + ID.AddInteger(Key.LineCol); + ID.AddInteger(Key.ScopeIdx); + return ID.ComputeHash(); +} + +bool DenseMapInfo<DebugLoc>::isEqual(const DebugLoc &LHS, const DebugLoc &RHS) { + return LHS == RHS; +} + +//===----------------------------------------------------------------------===// // LLVMContextImpl Implementation //===----------------------------------------------------------------------===// |