LLVM 22.0.0git
|
DWARFCFIAnalysis
validates the DWARF Call Frame Information one machine instruction at a time.
More...
#include "llvm/DWARFCFIChecker/DWARFCFIAnalysis.h"
Public Member Functions | |
LLVM_ABI | DWARFCFIAnalysis (MCContext *Context, MCInstrInfo const &MCII, bool IsEH, ArrayRef< MCCFIInstruction > Prologue) |
LLVM_ABI void | update (const MCInst &Inst, ArrayRef< MCCFIInstruction > Directives) |
DWARFCFIAnalysis
validates the DWARF Call Frame Information one machine instruction at a time.
This class maintains an internal CFI state initialized with the prologue directives and updated with each instruction's associated directives. In each update, it checks if the machine instruction changes the CFI state in a way that matches the changes from the CFI directives. This checking may results in errors and warnings.
In current stage, the analysis is only aware of what registers the instruction modifies. If the modification is happening to a sub-register, the analysis considers the super-register is modified.
In each update, for each register (or CFA), the following cases can happen:
The analysis only checks the CFA unwinding rule when the rule is a register plus some offset. Therefore, for CFA, only cases 1, 2.b, and 2.c are checked, and in all other case(s), a warning is emitted.
Definition at line 76 of file DWARFCFIAnalysis.h.
DWARFCFIAnalysis::DWARFCFIAnalysis | ( | MCContext * | Context, |
MCInstrInfo const & | MCII, | ||
bool | IsEH, | ||
ArrayRef< MCCFIInstruction > | Prologue | ||
) |
Definition at line 83 of file DWARFCFIAnalysis.cpp.
References assert(), Context, llvm::MCCFIInstruction::createOffset(), llvm::MCCFIInstruction::createSameValue(), llvm::MCCFIInstruction::createUndefined(), llvm::MCRegisterInfo::get(), getCFARegOffsetInfo(), llvm::DWARFCFIState::getCurrentUnwindRow(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MCRegisterInfo::getProgramCounter(), llvm::getTrackingRegs(), llvm::MCRegisterDesc::IsArtificial, llvm::MCRegisterDesc::IsConstant, and llvm::DWARFCFIState::update().
void DWARFCFIAnalysis::update | ( | const MCInst & | Inst, |
ArrayRef< MCCFIInstruction > | Directives | ||
) |
Definition at line 125 of file DWARFCFIAnalysis.cpp.
References assert(), llvm::MCInstrInfo::get(), llvm::DWARFCFIState::getCurrentUnwindRow(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MCInstrDesc::getNumDefs(), llvm::MCInst::getNumOperands(), llvm::MCInst::getOpcode(), llvm::MCInst::getOperand(), llvm::getSuperReg(), llvm::getTrackingRegs(), I, llvm::MCInstrDesc::implicit_defs(), llvm::MCInstrDesc::implicit_uses(), llvm::SmallSet< T, N, C >::insert(), llvm::SmallVectorImpl< T >::insert(), llvm::MCInstrDesc::NumImplicitDefs, llvm::MCInstrDesc::NumImplicitUses, llvm::DWARFCFIState::update(), and Writes.