34 auto Die = U->getDIEForOffset(U->getOffset() +
Operands[Operand]);
35 if (Die && Die.getTag() == dwarf::DW_TAG_base_type) {
41 OS <<
" \"" << *
Name <<
"\"";
52 OS <<
"<decoding error>";
115 assert(!SubName.
empty() &&
"DW_OP SubOp has no name!");
116 OS <<
" " << SubName;
147 else if (
Op->
getCode() != DW_OP_entry_value &&
163 for (
auto &
Op : *E) {
164 DumpOpts.
IsEH = IsEH;
167 while (FailOffset < E->getData().
size())
180 if (EntryValExprSize) {
182 if (EntryValExprSize == 0)
217 case dwarf::DW_OP_regx: {
221 auto RegName = GetNameForDWARFReg(DwarfRegNum,
false);
228 case dwarf::DW_OP_bregx: {
231 auto RegName = GetNameForDWARFReg(DwarfRegNum,
false);
240 case dwarf::DW_OP_entry_value:
241 case dwarf::DW_OP_GNU_entry_value: {
254 case dwarf::DW_OP_stack_value: {
261 case dwarf::DW_OP_nop: {
264 case dwarf::DW_OP_LLVM_user: {
269 if (Opcode >= dwarf::DW_OP_reg0 && Opcode <= dwarf::DW_OP_reg31) {
272 uint64_t DwarfRegNum = Opcode - dwarf::DW_OP_reg0;
273 auto RegName = GetNameForDWARFReg(DwarfRegNum,
false);
278 }
else if (Opcode >= dwarf::DW_OP_breg0 &&
279 Opcode <= dwarf::DW_OP_breg31) {
280 int DwarfRegNum = Opcode - dwarf::DW_OP_breg0;
282 auto RegName = GetNameForDWARFReg(DwarfRegNum,
false);
293 << (int)Opcode <<
")>";
301 if (Stack.size() != 1) {
302 OS <<
"<stack of size " << Stack.size() <<
", expected 1>";
307 OS <<
"[" << Stack.front().String <<
"]";
309 OS << Stack.front().String;
329 if (Opcode == DW_OP_bregx || Opcode == DW_OP_regx ||
330 Opcode == DW_OP_regval_type)
332 else if (Opcode >= DW_OP_breg0 && Opcode < DW_OP_bregx)
333 DwarfRegNum = Opcode - DW_OP_breg0;
335 DwarfRegNum = Opcode - DW_OP_reg0;
339 if ((Opcode >= DW_OP_breg0 && Opcode <= DW_OP_breg31) ||
340 Opcode == DW_OP_bregx)
345 if (Opcode == DW_OP_regval_type)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
mir Rename Register Operands
This file defines the SmallString class.
ArrayRef - 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
uint64_t getEndOffset() const
ArrayRef< uint64_t > getRawOperands() const
@ SizeSubOpLEB
The operand is a ULEB128 encoded SubOpcode.
@ SizeBlock
Preceding operand contains block size.
const Description & getDescription() const
uint64_t getRawOperand(unsigned Idx) const
An iterator to go through the expression operations.
StringRef getData() const
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
LLVM_ABI StringRef SubOperationEncodingString(unsigned OpEncoding, unsigned SubOpEncoding)
LLVM_ABI StringRef OperationEncodingString(unsigned Encoding)
std::optional< const char * > toString(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
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.
static bool printOp(const DWARFExpression::Operation *Op, raw_ostream &OS, DIDumpOptions DumpOpts, const DWARFExpression *Expr, DWARFUnit *U)
LLVM_ABI void printDwarfExpression(const DWARFExpression *E, raw_ostream &OS, DIDumpOptions DumpOpts, DWARFUnit *U, bool IsEH=false)
Print a Dwarf expression/.
static bool printCompactDWARFExpr(raw_ostream &OS, DWARFExpression::iterator I, const DWARFExpression::iterator E, std::function< StringRef(uint64_t RegNum, bool IsEH)> GetNameForDWARFReg=nullptr)
static void prettyPrintBaseTypeRef(DWARFUnit *U, raw_ostream &OS, DIDumpOptions DumpOpts, ArrayRef< uint64_t > Operands, unsigned Operand)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
DWARFExpression::Operation Op
LLVM_ABI bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS, DIDumpOptions DumpOpts, uint8_t Opcode, ArrayRef< uint64_t > Operands)
Pretty print a register opcode and operands.
LLVM_ABI bool printDwarfExpressionCompact(const DWARFExpression *E, raw_ostream &OS, std::function< StringRef(uint64_t RegNum, bool IsEH)> GetNameForDWARFReg=nullptr)
Print the expression in a format intended to be compact and useful to a user, but not perfectly unamb...
Container for dump options that control which debug information will be dumped.
std::function< llvm::StringRef(uint64_t DwarfRegNum, bool IsEH)> GetNameForDWARFReg
Description of the encoding of one expression Op.
SmallVector< Encoding > Op
Encoding for Op operands.
A user-facing string representation of a DWARF expression.
PrintedExpr(ExprKind K=Address)