22 std::map<uint64_t, uint64_t> LineTableMapping;
26 if (LT.Rows.empty()) {
27 for (
const auto &[Off, Row] : LineTableMapping)
28 SeqOffToFirstRow[Off] = Row;
73 constexpr uint64_t DummyKey = std::numeric_limits<uint64_t>::max();
74 constexpr uint64_t DummyVal = std::numeric_limits<uint64_t>::max();
75 LineTableMapping[DummyKey] = DummyVal;
77 for (
auto [NextSeqOff, NextRow] : LineTableMapping) {
78 auto StmtAttrSmallerThanNext = [
N = NextSeqOff](
uint64_t SA) {
81 auto SeqStartSmallerThanNext = [
N = NextRow](
uint64_t Row) {
86 while (!StmtAttrsRef.
empty() && !SeqStartRowsRef.
empty() &&
87 StmtAttrSmallerThanNext(StmtAttrsRef.
front()) &&
88 SeqStartSmallerThanNext(SeqStartRowsRef.
front())) {
95 StmtAttrsRef = StmtAttrsRef.
drop_while(StmtAttrSmallerThanNext);
96 SeqStartRowsRef = SeqStartRowsRef.
drop_while(SeqStartSmallerThanNext);
97 if (NextSeqOff != DummyKey)
98 SeqOffToFirstRow[NextSeqOff] = NextRow;
101 if (!StmtAttrsRef.
empty() && StmtAttrsRef.
front() == NextSeqOff)
103 if (!SeqStartRowsRef.
empty() && SeqStartRowsRef.
front() == NextRow)
104 SeqStartRowsRef = SeqStartRowsRef.
drop_front();
void buildStmtSeqOffsetToFirstRowIndex(const DWARFDebugLine::LineTable <, ArrayRef< uint64_t > SortedStmtSeqOffsets, DenseMap< uint64_t, uint64_t > &SeqOffToFirstRow)
Build a map from an input DW_AT_LLVM_stmt_sequence byte offset to the first-row index (in LT....
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...