aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-01 01:15:28 +0000
committerDevang Patel <dpatel@apple.com>2009-10-01 01:15:28 +0000
commitf736728788cddfb56d44fb826cb5d91dfdbfe294 (patch)
tree91dfb9a92f10fa56c668d69e9ece0099fd5e7433 /include/llvm
parent539f434334ae6cc5becba8b3099eb20ab7fe48dc (diff)
downloadexternal_llvm-f736728788cddfb56d44fb826cb5d91dfdbfe294.zip
external_llvm-f736728788cddfb56d44fb826cb5d91dfdbfe294.tar.gz
external_llvm-f736728788cddfb56d44fb826cb5d91dfdbfe294.tar.bz2
Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/DebugLoc.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h
index 358cfe3..30590c7 100644
--- a/include/llvm/Support/DebugLoc.h
+++ b/include/llvm/Support/DebugLoc.h
@@ -25,17 +25,19 @@ namespace llvm {
///
struct DebugLocTuple {
MDNode *CompileUnit;
+ MDNode *InlinedLoc;
unsigned Line, Col;
DebugLocTuple()
- : CompileUnit(0), Line(~0U), Col(~0U) {};
+ : CompileUnit(0), InlinedLoc(0), Line(~0U), Col(~0U) {};
- DebugLocTuple(MDNode *n, unsigned l, unsigned c)
- : CompileUnit(n), Line(l), Col(c) {};
+ DebugLocTuple(MDNode *n, MDNode *i, unsigned l, unsigned c)
+ : CompileUnit(n), InlinedLoc(i), Line(l), Col(c) {};
bool operator==(const DebugLocTuple &DLT) const {
return CompileUnit == DLT.CompileUnit &&
- Line == DLT.Line && Col == DLT.Col;
+ InlinedLoc == DLT.InlinedLoc &&
+ Line == DLT.Line && Col == DLT.Col;
}
bool operator!=(const DebugLocTuple &DLT) const {
return !(*this == DLT);
@@ -66,18 +68,20 @@ namespace llvm {
// 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((MDNode*)~1U, ~1U, ~1U);
+ return DebugLocTuple((MDNode*)~1U, (MDNode*)~1U, ~1U, ~1U);
}
static unsigned getHashValue(const DebugLocTuple &Val) {
return DenseMapInfo<MDNode*>::getHashValue(Val.CompileUnit) ^
+ DenseMapInfo<MDNode*>::getHashValue(Val.InlinedLoc) ^
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.InlinedLoc == RHS.InlinedLoc &&
LHS.Line == RHS.Line &&
LHS.Col == RHS.Col;
}