aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/DebugLoc.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-04-30 23:22:31 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-04-30 23:22:31 +0000
commita26eae64ddf607549f9e47046d46ea5b9ec648b4 (patch)
treec120bcc5dae1ed6c28cdf9b86b0dac5b9c71a65e /include/llvm/CodeGen/DebugLoc.h
parent19fee415f63ddb78fca703085fe56510be3e058c (diff)
downloadexternal_llvm-a26eae64ddf607549f9e47046d46ea5b9ec648b4.zip
external_llvm-a26eae64ddf607549f9e47046d46ea5b9ec648b4.tar.gz
external_llvm-a26eae64ddf607549f9e47046d46ea5b9ec648b4.tar.bz2
Make DebugLoc independent of DwarfWriter.
-Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable* -Remove DwarfWriter::getOrCreateSourceID -Make necessary changes for the above (fix callsites, etc.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/DebugLoc.h')
-rw-r--r--include/llvm/CodeGen/DebugLoc.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/include/llvm/CodeGen/DebugLoc.h b/include/llvm/CodeGen/DebugLoc.h
index d5ad9dc..77e6733 100644
--- a/include/llvm/CodeGen/DebugLoc.h
+++ b/include/llvm/CodeGen/DebugLoc.h
@@ -19,17 +19,20 @@
#include <vector>
namespace llvm {
+ class GlobalVariable;
/// DebugLocTuple - Debug location tuple of filename id, line and column.
///
struct DebugLocTuple {
- unsigned Src, Line, Col;
+ GlobalVariable *CompileUnit;
+ unsigned Line, Col;
- DebugLocTuple(unsigned s, unsigned l, unsigned c)
- : Src(s), Line(l), Col(c) {};
+ DebugLocTuple(GlobalVariable *v, unsigned l, unsigned c)
+ : CompileUnit(v), Line(l), Col(c) {};
bool operator==(const DebugLocTuple &DLT) const {
- return Src == DLT.Src && Line == DLT.Line && Col == DLT.Col;
+ return CompileUnit == DLT.CompileUnit &&
+ Line == DLT.Line && Col == DLT.Col;
}
bool operator!=(const DebugLocTuple &DLT) const {
return !(*this == DLT);
@@ -60,20 +63,20 @@ namespace llvm {
// Partially specialize DenseMapInfo for DebugLocTyple.
template<> struct DenseMapInfo<DebugLocTuple> {
static inline DebugLocTuple getEmptyKey() {
- return DebugLocTuple(~0U, ~0U, ~0U);
+ return DebugLocTuple(0, ~0U, ~0U);
}
static inline DebugLocTuple getTombstoneKey() {
- return DebugLocTuple(~1U, ~1U, ~1U);
+ return DebugLocTuple((GlobalVariable*)~1U, ~1U, ~1U);
}
static unsigned getHashValue(const DebugLocTuple &Val) {
- return DenseMapInfo<unsigned>::getHashValue(Val.Src) ^
+ return DenseMapInfo<GlobalVariable*>::getHashValue(Val.CompileUnit) ^
DenseMapInfo<unsigned>::getHashValue(Val.Line) ^
DenseMapInfo<unsigned>::getHashValue(Val.Col);
}
static bool isEqual(const DebugLocTuple &LHS, const DebugLocTuple &RHS) {
- return LHS.Src == RHS.Src &&
- LHS.Line == RHS.Line &&
- LHS.Col == RHS.Col;
+ return LHS.CompileUnit == RHS.CompileUnit &&
+ LHS.Line == RHS.Line &&
+ LHS.Col == RHS.Col;
}
static bool isPod() { return true; }