22 std::optional<DWARFFormValue> Location = Die.
find(dwarf::DW_AT_location);
26 std::optional<ArrayRef<uint8_t>>
Block = Location->getAsBlock();
33 U->getFormParams().Format);
36 return !
Op.isError() && (
Op.getCode() == dwarf::DW_OP_addr ||
37 Op.getCode() == dwarf::DW_OP_addrx);
46 std::map<uint64_t, uint64_t> LineTableMapping;
50 if (LT.Rows.empty()) {
51 for (
const auto &[
Off, Row] : LineTableMapping)
52 SeqOffToFirstRow[
Off] = Row;
97 constexpr uint64_t DummyKey = std::numeric_limits<uint64_t>::max();
98 constexpr uint64_t DummyVal = std::numeric_limits<uint64_t>::max();
99 LineTableMapping[DummyKey] = DummyVal;
101 for (
auto [NextSeqOff, NextRow] : LineTableMapping) {
102 auto StmtAttrSmallerThanNext = [
N = NextSeqOff](
uint64_t SA) {
105 auto SeqStartSmallerThanNext = [
N = NextRow](
uint64_t Row) {
110 while (!StmtAttrsRef.
empty() && !SeqStartRowsRef.
empty() &&
111 StmtAttrSmallerThanNext(StmtAttrsRef.
front()) &&
112 SeqStartSmallerThanNext(SeqStartRowsRef.
front())) {
119 StmtAttrsRef = StmtAttrsRef.
drop_while(StmtAttrSmallerThanNext);
120 SeqStartRowsRef = SeqStartRowsRef.
drop_while(SeqStartSmallerThanNext);
121 if (NextSeqOff != DummyKey)
122 SeqOffToFirstRow[NextSeqOff] = NextRow;
125 if (!StmtAttrsRef.
empty() && StmtAttrsRef.
front() == NextSeqOff)
127 if (!SeqStartRowsRef.
empty() && SeqStartRowsRef.
front() == NextRow)
128 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.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
LLVM_ABI std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
DWARFUnit * getDwarfUnit() const
This class represents an Operation in the Expression.
Class representing an expression and its matching format.
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 bool hasImplicitAddressLocation(const DWARFDie &Die)
Test if the location of variable Die contains a global address but only uses to compute the variable'...
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,...
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
DWARFExpression::Operation Op
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.