aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/DebugLoc.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-08-25 05:24:07 +0000
committerDevang Patel <dpatel@apple.com>2009-08-25 05:24:07 +0000
commit2a610c7387664bc557a35ce3bb4c0d4df56e4755 (patch)
tree48270c87c6b683ff972a9e35651d27e620881118 /include/llvm/Support/DebugLoc.h
parent4bda11fbdafc1d4fa97b7539bdf5a0f62ecfc280 (diff)
Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/DebugLoc.h')
-rw-r--r--include/llvm/Support/DebugLoc.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h
index 8ef7e4afc4..0bfad7cc0b 100644
--- a/include/llvm/Support/DebugLoc.h
+++ b/include/llvm/Support/DebugLoc.h
@@ -19,19 +19,19 @@
#include <vector>
namespace llvm {
- class GlobalVariable;
+ class MDNode;
/// DebugLocTuple - Debug location tuple of filename id, line and column.
///
struct DebugLocTuple {
- GlobalVariable *CompileUnit;
+ MDNode *CompileUnit;
unsigned Line, Col;
DebugLocTuple()
: CompileUnit(0), Line(~0U), Col(~0U) {};
- DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c)
- : CompileUnit(v), Line(l), Col(c) {};
+ DebugLocTuple(MDNode *n, unsigned l, unsigned c)
+ : CompileUnit(n), Line(l), Col(c) {};
bool operator==(const DebugLocTuple &DLT) const {
return CompileUnit == DLT.CompileUnit &&
@@ -69,10 +69,10 @@ namespace llvm {
return DebugLocTuple(0, ~0U, ~0U);
}
static inline DebugLocTuple getTombstoneKey() {
- return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U);
+ return DebugLocTuple((MDNode*)~1U, ~1U, ~1U);
}
static unsigned getHashValue(const DebugLocTuple &Val) {
- return DenseMapInfo<GlobalVariable*>::getHashValue(Val.CompileUnit) ^
+ return DenseMapInfo<MDNode*>::getHashValue(Val.CompileUnit) ^
DenseMapInfo<unsigned>::getHashValue(Val.Line) ^
DenseMapInfo<unsigned>::getHashValue(Val.Col);
}