LLVM: llvm::BTFDebug Class Reference (original) (raw)

Collect and emit BTF information. More...

#include "[Target/BPF/BTFDebug.h](BTFDebug%5F8h%5Fsource.html)"

Public Member Functions
BTFDebug (AsmPrinter *AP)
bool InstLower (const MachineInstr *MI, MCInst &OutMI)
Emit proper patchable instructions.
uint32_t getArrayIndexTypeId ()
Get the special array index type id.
size_t addString (StringRef S)
Add string to the string table.
uint32_t getTypeId (const DIType *Ty)
Get the type id for a particular DIType.
void beginInstruction (const MachineInstr *MI) override
Process beginning of an instruction.
void endModule () override
Complete all the types and emit the BTF sections.
Public Member Functions inherited from llvm::DebugHandlerBase
~DebugHandlerBase () override
void beginModule (Module *M) override
void beginInstruction (const MachineInstr *MI) override
Process beginning of an instruction.
void endInstruction () override
Process end of an instruction.
void beginFunction (const MachineFunction *MF) override
Gather pre-function debug information.
void endFunction (const MachineFunction *MF) override
Gather post-function debug information.
void beginBasicBlockSection (const MachineBasicBlock &MBB) override
Process the beginning of a new basic-block-section within a function.
void endBasicBlockSection (const MachineBasicBlock &MBB) override
Process the end of a basic-block-section within a function.
MCSymbol * getLabelBeforeInsn (const MachineInstr *MI)
Return Label preceding the instruction.
MCSymbol * getLabelAfterInsn (const MachineInstr *MI)
Return Label immediately following the instruction.
const InstructionOrdering & getInstOrdering () const
const LexicalScopes & getLexicalScopes () const
Public Member Functions inherited from llvm::AsmPrinterHandler
virtual ~AsmPrinterHandler ()
Pin vtables to this file.
virtual void markFunctionEnd ()
virtual void setSymbolSize (const MCSymbol *Sym, uint64_t Size)
For symbols that have a size designated (e.g.
virtual void beginCodeAlignment (const MachineBasicBlock &MBB)
virtual void beginFunclet (const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr)
Emit target-specific EH funclet machinery.
virtual void endFunclet ()
Protected Member Functions
void beginFunctionImpl (const MachineFunction *MF) override
Gather pre-function debug information.
void endFunctionImpl (const MachineFunction *MF) override
Post process after all instructions in this function are processed.
Protected Member Functions inherited from llvm::DebugHandlerBase
DebugHandlerBase (AsmPrinter *A)
void identifyScopeMarkers ()
Indentify instructions that are marking the beginning of or ending of a scope.
void requestLabelBeforeInsn (const MachineInstr *MI)
Ensure that a label will be emitted before MI.
void requestLabelAfterInsn (const MachineInstr *MI)
Ensure that a label will be emitted after MI.
virtual void skippedNonDebugFunction ()
Additional Inherited Members
Static Public Member Functions inherited from llvm::DebugHandlerBase
static uint64_t getBaseTypeSize (const DIType *Ty)
If this type is derived from a base type then return base type size.
static bool isUnsignedDIType (const DIType *Ty)
Return true if type encoding is unsigned.
Protected Attributes inherited from llvm::DebugHandlerBase
AsmPrinter * Asm = nullptr
Target of debug info emission.
MachineModuleInfo * MMI = nullptr
Collected machine module information.
DebugLoc PrevInstLoc
Previous instruction's location information.
MCSymbol * PrevLabel = nullptr
const MachineBasicBlock * PrevInstBB = nullptr
const MachineInstr * PrologEndLoc
This location indicates end of function prologue and beginning of function body.
const MachineBasicBlock * EpilogBeginBlock = nullptr
This block includes epilogue instructions.
const MachineInstr * CurMI = nullptr
If nonnull, stores the current machine instruction we're processing.
LexicalScopes LScopes
DbgValueHistoryMap DbgValues
History of DBG_VALUE and clobber instructions for each user variable.
DbgLabelInstrMap DbgLabels
Mapping of inlined labels and DBG_LABEL machine instruction.
DenseMap< const MachineInstr *, MCSymbol * > LabelsBeforeInsn
Maps instruction with label emitted before instruction.
DenseMap< const MachineInstr *, MCSymbol * > LabelsAfterInsn
Maps instruction with label emitted after instruction.

Collect and emit BTF information.

Definition at line 289 of file BTFDebug.h.

addString()

size_t llvm::BTFDebug::addString ( StringRef S) inline

Add string to the string table.

Definition at line 418 of file BTFDebug.h.

Referenced by beginFunctionImpl(), BTFDebug(), llvm::BTFKindDataSec::completeType(), llvm::BTFKindVar::completeType(), llvm::BTFTypeDeclTag::completeType(), llvm::BTFTypeDerived::completeType(), llvm::BTFTypeEnum64::completeType(), llvm::BTFTypeEnum::completeType(), llvm::BTFTypeFloat::completeType(), llvm::BTFTypeFunc::completeType(), llvm::BTFTypeFuncProto::completeType(), llvm::BTFTypeFwd::completeType(), llvm::BTFTypeInt::completeType(), llvm::BTFTypeStruct::completeType(), and llvm::BTFTypeTypeTag::completeType().

beginFunctionImpl()

Gather pre-function debug information.

Implements llvm::DebugHandlerBase.

Definition at line 1283 of file BTFDebug.cpp.

References addString(), llvm::DebugHandlerBase::Asm, llvm::dyn_cast(), llvm::BTF::FUNC_GLOBAL, llvm::BTF::FUNC_STATIC, llvm::MachineFunction::getFunction(), llvm::MCSection::getName(), llvm::MCSymbol::getSection(), llvm::Function::getSubprogram(), llvm::MCSymbol::isInSection(), llvm::BTFFuncInfo::Label, llvm::DICompileUnit::NoDebug, and llvm::BTFFuncInfo::TypeId.

beginInstruction()

Process beginning of an instruction.

Reimplemented from llvm::AsmPrinterHandler.

Definition at line 1429 of file BTFDebug.cpp.

References llvm::DebugHandlerBase::Asm, llvm::DebugHandlerBase::beginInstruction(), llvm::DebugHandlerBase::CurMI, DL, llvm::dyn_cast(), llvm::MachineInstr::FrameSetup, llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getSymbolName(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isReg(), MI, and llvm::DebugHandlerBase::PrevInstLoc.

endFunctionImpl()

endModule()

void BTFDebug::endModule ( ) overridevirtual

getArrayIndexTypeId()

uint32_t llvm::BTFDebug::getArrayIndexTypeId ( ) inline

getTypeId()

InstLower()

Emit proper patchable instructions.

Definition at line 1642 of file BTFDebug.cpp.

References llvm::MCInst::addOperand(), llvm::BPFCoreSharedInfo::AmaAttr, llvm::BTF::BTF_TYPE_ID_LOCAL, llvm::BTF::BTF_TYPE_ID_REMOTE, llvm::MCOperand::createImm(), llvm::MCOperand::createReg(), llvm::dyn_cast(), llvm::BTF::ENUM_VALUE, llvm::BTF::ENUM_VALUE_EXISTENCE, llvm::MachineOperand::getGlobal(), llvm::GlobalVariable::hasAttribute(), llvm::MachineOperand::isGlobal(), MI, llvm::MCInst::setOpcode(), and llvm::BPFCoreSharedInfo::TypeIdAttr.


The documentation for this class was generated from the following files: