[DWARF] Fix a bug in line info handling
[oota-llvm.git] / include / llvm / DebugInfo / DWARF / DWARFDebugLine.h
index 5f223d4dc4e681a864927a2fd72e8f2fc394bd3e..93e7c790ccf90b8fb362d409a4a6482a40d9ad55 100644 (file)
@@ -171,6 +171,9 @@ public:
   struct LineTable {
     LineTable();
 
+    // Represents an invalid row
+    const uint32_t UnknownRowIndex = UINT32_MAX;
+
     void appendRow(const DWARFDebugLine::Row &R) {
       Rows.push_back(R);
     }
@@ -179,7 +182,7 @@ public:
     }
 
     // Returns the index of the row with file/line info for a given address,
-    // or -1 if there is no such row.
+    // or UnknownRowIndex if there is no such row.
     uint32_t lookupAddress(uint64_t address) const;
 
     bool lookupAddressRange(uint64_t address, uint64_t size,
@@ -211,6 +214,10 @@ public:
     typedef SequenceVector::const_iterator SequenceIter;
     RowVector Rows;
     SequenceVector Sequences;
+
+  private:
+    uint32_t findRowInSeq(const DWARFDebugLine::Sequence &seq,
+                          uint64_t address) const;
   };
 
   const LineTable *getLineTable(uint32_t offset) const;