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);
42 assert(Die.
getTag() == dwarf::DW_TAG_member &&
"expected a DW_TAG_member");
52 {dwarf::DW_AT_data_member_location, dwarf::DW_AT_data_bit_offset});
57 case dwarf::DW_TAG_class_type:
58 case dwarf::DW_TAG_enumeration_type:
59 case dwarf::DW_TAG_interface_type:
60 case dwarf::DW_TAG_structure_type:
61 case dwarf::DW_TAG_union_type:
72 case dwarf::DW_TAG_member:
74 case dwarf::DW_TAG_enumerator:
75 case dwarf::DW_TAG_inheritance:
87 std::map<uint64_t, uint64_t> LineTableMapping;
91 if (LT.Rows.empty()) {
92 for (
const auto &[
Off, Row] : LineTableMapping)
93 SeqOffToFirstRow[
Off] = Row;
138 constexpr uint64_t DummyKey = std::numeric_limits<uint64_t>::max();
139 constexpr uint64_t DummyVal = std::numeric_limits<uint64_t>::max();
140 LineTableMapping[DummyKey] = DummyVal;
142 for (
auto [NextSeqOff, NextRow] : LineTableMapping) {
143 auto StmtAttrSmallerThanNext = [
N = NextSeqOff](
uint64_t SA) {
146 auto SeqStartSmallerThanNext = [
N = NextRow](
uint64_t Row) {
151 while (!StmtAttrsRef.
empty() && !SeqStartRowsRef.
empty() &&
152 StmtAttrSmallerThanNext(StmtAttrsRef.
front()) &&
153 SeqStartSmallerThanNext(SeqStartRowsRef.
front())) {
160 StmtAttrsRef = StmtAttrsRef.
drop_while(StmtAttrSmallerThanNext);
161 SeqStartRowsRef = SeqStartRowsRef.
drop_while(SeqStartSmallerThanNext);
162 if (NextSeqOff != DummyKey)
163 SeqOffToFirstRow[NextSeqOff] = NextRow;
166 if (!StmtAttrsRef.
empty() && StmtAttrsRef.
front() == NextSeqOff)
168 if (!SeqStartRowsRef.
empty() && SeqStartRowsRef.
front() == NextRow)
169 SeqStartRowsRef = SeqStartRowsRef.
drop_front();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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
dwarf::Tag getTag() 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 isIdentifiedByChildren(dwarf::Tag Tag)
Test if an unnamed type with tag Tag is identified by its children, which tell it apart from other un...
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....
LLVM_ABI bool isStaticDataMember(const DWARFDie &Die)
Test if the DW_TAG_member Die is a DWARF 2-4 style static data member: a declaration with no storage ...
LLVM_ABI bool isIdentifyingChild(const DWARFDie &Die)
Test if Die is a child that identifies its unnamed parent type.
std::optional< uint64_t > toUnsigned(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
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.