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();
Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > drop_while(PredicateT Pred) const
Return a copy of *this with the first N elements satisfying the given predicate removed.
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
const T & front() const
Get the first element.
bool empty() const
Check if the array is empty.
const T & consume_front()
consume_front() - Returns the first element and drops it from ArrayRef.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM_ABI 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....
This is an optimization pass for GlobalISel generic memory operations.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
ArrayRef(const T &OneElt) -> ArrayRef< T >
Represents a series of contiguous machine instructions.
uint64_t StmtSeqOffset
The offset into the line table where this sequence begins.