summaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/DebugLoc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/DebugLoc.h')
-rw-r--r--include/llvm/Support/DebugLoc.h33
1 files changed, 20 insertions, 13 deletions
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h
index 5c089ef..55c3c4f 100644
--- a/include/llvm/Support/DebugLoc.h
+++ b/include/llvm/Support/DebugLoc.h
@@ -19,20 +19,25 @@
#include <vector>
namespace llvm {
- class GlobalVariable;
+ class MDNode;
/// DebugLocTuple - Debug location tuple of filename id, line and column.
///
struct DebugLocTuple {
- GlobalVariable *CompileUnit;
+ MDNode *Scope;
+ MDNode *InlinedAtLoc;
unsigned Line, Col;
- DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c)
- : CompileUnit(v), Line(l), Col(c) {};
+ DebugLocTuple()
+ : Scope(0), InlinedAtLoc(0), Line(~0U), Col(~0U) {};
+
+ DebugLocTuple(MDNode *n, MDNode *i, unsigned l, unsigned c)
+ : Scope(n), InlinedAtLoc(i), Line(l), Col(c) {};
bool operator==(const DebugLocTuple &DLT) const {
- return CompileUnit == DLT.CompileUnit &&
- Line == DLT.Line && Col == DLT.Col;
+ return Scope == DLT.Scope &&
+ InlinedAtLoc == DLT.InlinedAtLoc &&
+ Line == DLT.Line && Col == DLT.Col;
}
bool operator!=(const DebugLocTuple &DLT) const {
return !(*this == DLT);
@@ -60,23 +65,25 @@ namespace llvm {
bool operator!=(const DebugLoc &DL) const { return !(*this == DL); }
};
- // Partially specialize DenseMapInfo for DebugLocTyple.
+ // Specialize DenseMapInfo for DebugLocTuple.
template<> struct DenseMapInfo<DebugLocTuple> {
static inline DebugLocTuple getEmptyKey() {
- return DebugLocTuple(0, ~0U, ~0U);
+ return DebugLocTuple(0, 0, ~0U, ~0U);
}
static inline DebugLocTuple getTombstoneKey() {
- return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U);
+ return DebugLocTuple((MDNode*)~1U, (MDNode*)~1U, ~1U, ~1U);
}
static unsigned getHashValue(const DebugLocTuple &Val) {
- return DenseMapInfo<GlobalVariable*>::getHashValue(Val.CompileUnit) ^
+ return DenseMapInfo<MDNode*>::getHashValue(Val.Scope) ^
+ DenseMapInfo<MDNode*>::getHashValue(Val.InlinedAtLoc) ^
DenseMapInfo<unsigned>::getHashValue(Val.Line) ^
DenseMapInfo<unsigned>::getHashValue(Val.Col);
}
static bool isEqual(const DebugLocTuple &LHS, const DebugLocTuple &RHS) {
- return LHS.CompileUnit == RHS.CompileUnit &&
- LHS.Line == RHS.Line &&
- LHS.Col == RHS.Col;
+ return LHS.Scope == RHS.Scope &&
+ LHS.InlinedAtLoc == RHS.InlinedAtLoc &&
+ LHS.Line == RHS.Line &&
+ LHS.Col == RHS.Col;
}
static bool isPod() { return true; }
OpenPOWER on IntegriCloud