diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-10-14 17:57:32 +0000 |
commit | cd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch) | |
tree | b21f6de4e08b89bb7931806bab798fc2a5e3a686 /include/llvm/Support/DebugLoc.h | |
parent | 72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff) | |
download | FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz |
Update llvm to r84119.
Diffstat (limited to 'include/llvm/Support/DebugLoc.h')
-rw-r--r-- | include/llvm/Support/DebugLoc.h | 33 |
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; } |