- DebugLoc() : Idx(~0U) {} // Defaults to invalid.
-
- static DebugLoc getUnknownLoc() { DebugLoc L; L.Idx = ~0U; return L; }
- static DebugLoc get(unsigned idx) { DebugLoc L; L.Idx = idx; return L; }
-
- unsigned getIndex() const { return Idx; }
-
- /// isUnknown - Return true if there is no debug info for the SDNode /
- /// MachineInstr.
- bool isUnknown() const { return Idx == ~0U; }
-
- bool operator==(const DebugLoc &DL) const { return Idx == DL.Idx; }
- 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);
+ DebugLoc() : LineCol(0), ScopeIdx(0) {} // Defaults to unknown.
+
+ /// get - Get a new DebugLoc that corresponds to the specified line/col
+ /// scope/inline location.
+ static DebugLoc get(unsigned Line, unsigned Col,
+ MDNode *Scope, MDNode *InlinedAt = 0);
+
+ /// getFromDILocation - Translate the DILocation quad into a DebugLoc.
+ static DebugLoc getFromDILocation(MDNode *N);
+
+ /// getFromDILexicalBlock - Translate the DILexicalBlock into a DebugLoc.
+ static DebugLoc getFromDILexicalBlock(MDNode *N);
+
+ /// isUnknown - Return true if this is an unknown location.
+ bool isUnknown() const { return ScopeIdx == 0; }
+
+ unsigned getLine() const {
+ return (LineCol << 8) >> 8; // Mask out column.