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.h53
1 files changed, 3 insertions, 50 deletions
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h
index 6814f63..32631fc 100644
--- a/include/llvm/Support/DebugLoc.h
+++ b/include/llvm/Support/DebugLoc.h
@@ -21,29 +21,6 @@
namespace llvm {
class MDNode;
- /// DebugLocTuple - Debug location tuple of filename id, line and column.
- ///
- struct DebugLocTuple {
- MDNode *Scope;
- MDNode *InlinedAtLoc;
- unsigned Line, Col;
-
- 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 Scope == DLT.Scope &&
- InlinedAtLoc == DLT.InlinedAtLoc &&
- Line == DLT.Line && Col == DLT.Col;
- }
- bool operator!=(const DebugLocTuple &DLT) const {
- return !(*this == DLT);
- }
- };
-
/// DebugLoc - Debug location id. This is carried by SDNode and MachineInstr
/// to index into a vector of unique debug location tuples.
class DebugLoc {
@@ -65,40 +42,16 @@ namespace llvm {
bool operator!=(const DebugLoc &DL) const { return !(*this == DL); }
};
- // Specialize DenseMapInfo for DebugLocTuple.
- template<> struct DenseMapInfo<DebugLocTuple> {
- static inline DebugLocTuple getEmptyKey() {
- return DebugLocTuple(0, 0, ~0U, ~0U);
- }
- static inline DebugLocTuple getTombstoneKey() {
- return DebugLocTuple((MDNode*)~1U, (MDNode*)~1U, ~1U, ~1U);
- }
- static unsigned getHashValue(const DebugLocTuple &Val) {
- 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.Scope == RHS.Scope &&
- LHS.InlinedAtLoc == RHS.InlinedAtLoc &&
- LHS.Line == RHS.Line &&
- LHS.Col == RHS.Col;
- }
- };
- template <> struct isPodLike<DebugLocTuple> {static const bool value = true;};
-
-
- /// DebugLocTracker - This class tracks debug location information.
+ /// DebugLocTracker - This class tracks debug location information.
///
struct DebugLocTracker {
/// DebugLocations - A vector of unique DebugLocTuple's.
///
- std::vector<DebugLocTuple> DebugLocations;
+ std::vector<MDNode *> DebugLocations;
/// DebugIdMap - This maps DebugLocTuple's to indices into the
/// DebugLocations vector.
- DenseMap<DebugLocTuple, unsigned> DebugIdMap;
+ DenseMap<MDNode *, unsigned> DebugIdMap;
DebugLocTracker() {}
};
OpenPOWER on IntegriCloud