9#ifndef LLVM_DEBUGINFO_DWARF_LOWLEVEL_DWARFEXPRESSION_H
10#define LLVM_DEBUGINFO_DWARF_LOWLEVEL_DWARFEXPRESSION_H
75 template <
typename... Ts>
101 return OperandEndOffsets;
104 return OperandEndOffsets[Idx];
112 std::optional<dwarf::DwarfFormat> Format);
124 : Expr(Expr), Offset(Offset) {
126 Offset >= Expr->Data.getData().
size() ||
127 !Op.extract(Expr->Data, Expr->AddressSize, Offset, Expr->Format);
135 Offset = Op.isError() ? Expr->Data.getData().size() : Op.EndOffset;
137 Offset >= Expr->Data.getData().size() ||
138 !Op.extract(Expr->Data, Expr->AddressSize, Offset, Expr->Format);
145 return iterator(Expr, Op.EndOffset +
Add);
153 std::optional<dwarf::DwarfFormat> Format = std::nullopt)
154 : Data(Data), AddressSize(AddressSize), Format(Format) {
155 assert(AddressSize == 8 || AddressSize == 4 || AddressSize == 2);
174 std::optional<dwarf::DwarfFormat> Format;
179 return LHS.Expr ==
RHS.Expr &&
LHS.Offset ==
RHS.Offset;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains constants used for implementing Dwarf debug support.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class represents an Operation in the Expression.
LLVM_ABI std::optional< unsigned > getSubCode() const
@ DwarfNA
Serves as a marker for unused entries.
uint64_t getNumOperands() const
uint64_t getEndOffset() const
ArrayRef< uint64_t > getRawOperands() const
Encoding
Size and signedness of expression operations' operands.
@ SizeSubOpLEB
The operand is a ULEB128 encoded SubOpcode.
@ SizeBlock
Preceding operand contains block size.
@ NvidiaMuxArg
The operand is a ULEB128 encoded selector naming an NVIDIA specific operation.
const Description & getDescription() const
ArrayRef< uint64_t > getOperandEndOffsets() const
uint64_t getOperandEndOffset(unsigned Idx) const
uint64_t getRawOperand(unsigned Idx) const
friend class DWARFVerifier
An iterator to go through the expression operations.
friend bool operator==(const iterator &, const iterator &)
friend class DWARFExpression
const Operation & operator*() const
iterator skipBytes(uint64_t Add) const
uint64_t getOffset() const
Get the byte offset of the current operation within the expression.
StringRef getData() const
LLVM_ABI bool isMemoryLocation() const
Test if this location description, or one of its pieces, is a memory location description.
DWARFExpression(DataExtractor Data, uint8_t AddressSize, std::optional< dwarf::DwarfFormat > Format=std::nullopt)
LLVM_ABI bool operator==(const DWARFExpression &RHS) const
friend class DWARFVerifier
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
Description of the encoding of one expression Op.
Description(DwarfVersion Version, Ts... Op)
DwarfVersion Version
Dwarf version where the Op was introduced.
SmallVector< Encoding > Op
Encoding for Op operands.