LLVM 19.0.0git
Public Member Functions | Protected Member Functions | List of all members
llvm::BTFDebug Class Reference

Collect and emit BTF information. More...

#include "Target/BPF/BTFDebug.h"

Inheritance diagram for llvm::BTFDebug:
Inheritance graph
[legend]

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
virtual ~DebugHandlerBase ()
 
virtual void setSymbolSize (const MCSymbol *Sym, uint64_t Size)
 For symbols that have a size designated (e.g.
 
virtual void beginModule (Module *M)
 
virtual void endModule ()=0
 
virtual void beginInstruction (const MachineInstr *MI)
 
virtual void endInstruction ()
 
void beginFunction (const MachineFunction *MF)
 
void endFunction (const MachineFunction *MF)
 
void beginBasicBlockSection (const MachineBasicBlock &MBB)
 
void endBasicBlockSection (const MachineBasicBlock &MBB)
 
MCSymbolgetLabelBeforeInsn (const MachineInstr *MI)
 Return Label preceding the instruction.
 
MCSymbolgetLabelAfterInsn (const MachineInstr *MI)
 Return Label immediately following the instruction.
 
const InstructionOrderinggetInstOrdering () const
 

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 beginFunctionImpl (const MachineFunction *MF)=0
 
virtual void endFunctionImpl (const MachineFunction *MF)=0
 
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
AsmPrinterAsm = nullptr
 Target of debug info emission.
 
MachineModuleInfoMMI = nullptr
 Collected machine module information.
 
DebugLoc PrevInstLoc
 Previous instruction's location information.
 
MCSymbolPrevLabel = nullptr
 
const MachineBasicBlockPrevInstBB = nullptr
 
DebugLoc PrologEndLoc
 This location indicates end of function prologue and beginning of function body.
 
const MachineBasicBlockEpilogBeginBlock = nullptr
 This block includes epilogue instructions.
 
const MachineInstrCurMI = 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.
 

Detailed Description

Collect and emit BTF information.

Definition at line 289 of file BTFDebug.h.

Constructor & Destructor Documentation

◆ BTFDebug()

BTFDebug::BTFDebug ( AsmPrinter AP)

Definition at line 508 of file BTFDebug.cpp.

References addString().

Member Function Documentation

◆ addString()

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

◆ beginFunctionImpl()

void BTFDebug::beginFunctionImpl ( const MachineFunction MF)
overrideprotectedvirtual

◆ beginInstruction()

void BTFDebug::beginInstruction ( const MachineInstr MI)
overridevirtual

◆ endFunctionImpl()

void BTFDebug::endFunctionImpl ( const MachineFunction MF)
overrideprotectedvirtual

Post process after all instructions in this function are processed.

Implements llvm::DebugHandlerBase.

Definition at line 1240 of file BTFDebug.cpp.

◆ endModule()

void BTFDebug::endModule ( )
overridevirtual

Complete all the types and emit the BTF sections.

Implements llvm::DebugHandlerBase.

Definition at line 1608 of file BTFDebug.cpp.

References Fixup, llvm::DIType::getName(), llvm::StructType::getName(), llvm::DINode::getTag(), and llvm::BTFTypeDerived::setPointeeType().

◆ getArrayIndexTypeId()

uint32_t llvm::BTFDebug::getArrayIndexTypeId ( )
inline

Get the special array index type id.

Definition at line 411 of file BTFDebug.h.

References assert().

Referenced by llvm::BTFTypeArray::completeType().

◆ getTypeId()

uint32_t llvm::BTFDebug::getTypeId ( const DIType Ty)
inline

◆ InstLower()

bool BTFDebug::InstLower ( const MachineInstr MI,
MCInst OutMI 
)

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