23 std::vector<Desc> Descriptions;
24 Descriptions.resize(0xff);
67 for (
uint16_t LA = DW_OP_lit0; LA <= DW_OP_lit31; ++LA)
69 for (
uint16_t LA = DW_OP_reg0; LA <= DW_OP_reg31; ++LA)
71 for (
uint16_t LA = DW_OP_breg0; LA <= DW_OP_breg31; ++LA)
87 Descriptions[DW_OP_implicit_value] =
90 Descriptions[DW_OP_implicit_pointer] =
96 Descriptions[DW_OP_regval_type] =
98 Descriptions[DW_OP_WASM_location] =
104 Descriptions[DW_OP_GNU_implicit_pointer] =
115 if (Opcode >= Descriptions.
size())
117 return Descriptions[Opcode];
126 static constexpr unsigned LlvmUserDescriptionsSize = 1
127#define HANDLE_DW_OP_LLVM_USEROP(ID, NAME) +1
128#include "llvm/BinaryFormat/Dwarf.def"
130 std::vector<Desc> Descriptions;
131 Descriptions.resize(LlvmUserDescriptionsSize);
137 assert(Opcode == DW_OP_LLVM_user);
144 std::optional<DwarfFormat>
Format) {
146 Opcode = Data.getU8(&
Offset);
154 for (
unsigned Operand = 0; Operand <
Desc.
Op.
size(); ++Operand) {
160 assert(Operand == 0 &&
"SubOp operand must be the first operand");
161 Operands[Operand] = Data.getULEB128(&
Offset);
166 "SizeSubOpLEB Description must begin with SizeSubOpLEB operand");
169 Operands[Operand] = Data.getU8(&
Offset);
171 Operands[Operand] = (int8_t)Operands[Operand];
174 Operands[Operand] = Data.getU16(&
Offset);
176 Operands[Operand] = (int16_t)Operands[Operand];
179 Operands[Operand] = Data.getU32(&
Offset);
181 Operands[Operand] = (int32_t)Operands[Operand];
184 Operands[Operand] = Data.getU64(&
Offset);
187 Operands[Operand] = Data.getUnsigned(&
Offset, AddressSize);
197 Operands[Operand] = Data.getSLEB128(&
Offset);
199 Operands[Operand] = Data.getULEB128(&
Offset);
202 Operands[Operand] = Data.getULEB128(&
Offset);
206 switch (Operands[0]) {
211 Operands[Operand] = Data.getULEB128(&
Offset);
214 Operands[Operand] = Data.getU32(&
Offset);
225 Operands[Operand] =
Offset;
226 Offset += Operands[Operand - 1];
232 OperandEndOffsets[Operand] =
Offset;
246 if (AddressSize !=
RHS.AddressSize || Format !=
RHS.Format)
248 return Data.getData() ==
RHS.Data.getData();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
mir Rename Register Operands
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
This class represents an Operation in the Expression.
LLVM_ABI std::optional< unsigned > getSubCode() const
@ DwarfNA
Serves as a marker for unused entries.
@ SizeSubOpLEB
The operand is a ULEB128 encoded SubOpcode.
@ SizeBlock
Preceding operand contains block size.
LLVM_ABI bool operator==(const DWARFExpression &RHS) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
This is an optimization pass for GlobalISel generic memory operations.
static Desc getSubOpDesc(unsigned Opcode, unsigned SubOpcode)
static std::vector< Desc > getOpDescriptions()
static Desc getDescImpl(ArrayRef< Desc > Descriptions, unsigned Opcode)
DWARFExpression::Operation Op
static Desc getOpDesc(unsigned Opcode)
static std::vector< Desc > getSubOpDescriptions()
Description of the encoding of one expression Op.
DwarfVersion Version
Dwarf version where the Op was introduced.
SmallVector< Encoding > Op
Encoding for Op operands.