diff options
-rw-r--r-- | include/llvm/Support/DebugLoc.h | 12 | ||||
-rw-r--r-- | lib/VMCore/DebugLoc.cpp | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h index 764591cfed..8d19e300ec 100644 --- a/include/llvm/Support/DebugLoc.h +++ b/include/llvm/Support/DebugLoc.h @@ -27,11 +27,19 @@ namespace llvm { class DebugLoc { friend struct DenseMapInfo<DebugLoc>; + /// getEmptyKey() - A private constructor that returns an unknown that is + /// not equal to the tombstone key or DebugLoc(). + static DebugLoc getEmptyKey() { + DebugLoc DL; + DL.LineCol = -1; + return DL; + } + /// getTombstoneKey() - A private constructor that returns an unknown that - /// is distinguishable from the usual one. + /// is not equal to the empty key or DebugLoc(). static DebugLoc getTombstoneKey() { DebugLoc DL; - DL.LineCol = -1; + DL.LineCol = -2; return DL; } diff --git a/lib/VMCore/DebugLoc.cpp b/lib/VMCore/DebugLoc.cpp index cb077cb437..35691627f4 100644 --- a/lib/VMCore/DebugLoc.cpp +++ b/lib/VMCore/DebugLoc.cpp @@ -133,7 +133,7 @@ DebugLoc DebugLoc::getFromDILocation(MDNode *N) { //===----------------------------------------------------------------------===// DebugLoc DenseMapInfo<DebugLoc>::getEmptyKey() { - return DebugLoc(); + return DebugLoc::getEmptyKey(); } DebugLoc DenseMapInfo<DebugLoc>::getTombstoneKey() { |