48 if (
Error Err = parseRows(CFIP, NewRow,
nullptr).takeError()) {
51 formatv(
"could not parse this CFI directive due to: {0}",
65 Context->getTargetTriple().getArch());
70 CFIP.addInstruction(dwarf::DW_CFA_same_value,
Directive.getRegister());
78 Context->reportWarning(
Directive.getLoc(),
79 "this directive is not supported, ignoring it");
87 Context->reportWarning(
Directive.getLoc(),
88 "this directive is not supported, ignoring it");
91 CFIP.addInstruction(dwarf::DW_CFA_offset,
Directive.getRegister(),
95 CFIP.addInstruction(dwarf::DW_CFA_LLVM_def_aspace_cfa,
99 CFIP.addInstruction(dwarf::DW_CFA_def_cfa_register,
103 CFIP.addInstruction(dwarf::DW_CFA_def_cfa_offset,
Directive.getOffset());
106 CFIP.addInstruction(dwarf::DW_CFA_def_cfa,
Directive.getRegister(),
112 "cannot define relative offset to a non-existing CFA unwinding rule");
114 CFIP.addInstruction(dwarf::DW_CFA_offset,
Directive.getRegister(),
115 Directive.getOffset() - Row.getCFAValue().getOffset());
119 "cannot adjust CFA offset of a non-existing CFA unwinding rule");
121 CFIP.addInstruction(dwarf::DW_CFA_def_cfa_offset,
122 Directive.getOffset() + Row.getCFAValue().getOffset());
126 Context->reportWarning(
Directive.getLoc(),
127 "this directive is not supported, ignoring it");
134 Context->reportWarning(
136 "this directive behavior depends on the assembler, ignoring it");
139 CFIP.addInstruction(dwarf::DW_CFA_undefined,
Directive.getRegister());
142 CFIP.addInstruction(dwarf::DW_CFA_register,
Directive.getRegister(),
146 CFIP.addInstruction(dwarf::DW_CFA_GNU_window_save);
149 CFIP.addInstruction(dwarf::DW_CFA_AARCH64_negate_ra_state);
152 CFIP.addInstruction(dwarf::DW_CFA_AARCH64_negate_ra_state_with_pc);
155 CFIP.addInstruction(dwarf::DW_CFA_GNU_args_size);
161 CFIP.addInstruction(dwarf::DW_CFA_val_offset,
Directive.getRegister(),
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares DWARFCFIState class.
This file contains constants used for implementing Dwarf debug support.
LLVM_ABI std::optional< dwarf::UnwindRow > getCurrentUnwindRow() const
LLVM_ABI void update(const MCCFIInstruction &Directive)
This method updates the state by applying Directive to the current state.
Lightweight error class with error context and mandatory checking.
Represent a sequence of Call Frame Information instructions that, when read in order,...
A class that represents a single row in the unwind table that is decoded by parsing the DWARF Call Fr...
std::vector< UnwindRow > RowContainer
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)