X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FDebugLoc.h;h=049807570711442dbb3ecb97f180f255143108a4;hb=55907d1274ce715b92d584e305e0708e333a33c0;hp=8d19e300ec2557fd0b4c58520567d8e4e9754657;hpb=4841121580df86b327013d1fab2a9339be487bce;p=oota-llvm.git diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h index 8d19e300ec2..04980757071 100644 --- a/include/llvm/Support/DebugLoc.h +++ b/include/llvm/Support/DebugLoc.h @@ -15,9 +15,8 @@ #ifndef LLVM_SUPPORT_DEBUGLOC_H #define LLVM_SUPPORT_DEBUGLOC_H -#include "llvm/ADT/DenseMapInfo.h" - namespace llvm { + template struct DenseMapInfo; class MDNode; class LLVMContext; @@ -31,7 +30,7 @@ namespace llvm { /// not equal to the tombstone key or DebugLoc(). static DebugLoc getEmptyKey() { DebugLoc DL; - DL.LineCol = -1; + DL.LineCol = 1; return DL; } @@ -39,7 +38,7 @@ namespace llvm { /// is not equal to the empty key or DebugLoc(). static DebugLoc getTombstoneKey() { DebugLoc DL; - DL.LineCol = -2; + DL.LineCol = 2; return DL; } @@ -61,7 +60,10 @@ namespace llvm { /// getFromDILocation - Translate the DILocation quad into a DebugLoc. static DebugLoc getFromDILocation(MDNode *N); - + + /// getFromDILexicalBlock - Translate the DILexicalBlock into a DebugLoc. + static DebugLoc getFromDILexicalBlock(MDNode *N); + /// isUnknown - Return true if this is an unknown location. bool isUnknown() const { return ScopeIdx == 0; } @@ -94,14 +96,16 @@ namespace llvm { return LineCol == DL.LineCol && ScopeIdx == DL.ScopeIdx; } bool operator!=(const DebugLoc &DL) const { return !(*this == DL); } + + void dump(const LLVMContext &Ctx) const; }; template <> struct DenseMapInfo { - static DebugLoc getEmptyKey(); - static DebugLoc getTombstoneKey(); + static DebugLoc getEmptyKey() { return DebugLoc::getEmptyKey(); } + static DebugLoc getTombstoneKey() { return DebugLoc::getTombstoneKey(); } static unsigned getHashValue(const DebugLoc &Key); - static bool isEqual(const DebugLoc &LHS, const DebugLoc &RHS); + static bool isEqual(DebugLoc LHS, DebugLoc RHS) { return LHS == RHS; } }; } // end namespace llvm