LLVM  10.0.0svn
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]
Collaboration diagram for llvm::BTFDebug:
Collaboration graph
[legend]

Public Member Functions

 BTFDebug (AsmPrinter *AP)
 
bool InstLower (const MachineInstr *MI, MCInst &OutMI)
 Emit proper patchable instructions. More...
 
uint32_t getArrayIndexTypeId ()
 Get the special array index type id. More...
 
size_t addString (StringRef S)
 Add string to the string table. More...
 
uint32_t getTypeId (const DIType *Ty)
 Get the type id for a particular DIType. More...
 
void setSymbolSize (const MCSymbol *Symbol, uint64_t Size) override
 For symbols that have a size designated (e.g. More...
 
void beginInstruction (const MachineInstr *MI) override
 Process beginning of an instruction. More...
 
void endModule () override
 Complete all the types and emit the BTF sections. More...
 
- Public Member Functions inherited from llvm::DebugHandlerBase
void endInstruction () override
 Process end of an instruction. More...
 
void beginFunction (const MachineFunction *MF) override
 Gather pre-function debug information. More...
 
void endFunction (const MachineFunction *MF) override
 Gather post-function debug information. More...
 
MCSymbolgetLabelBeforeInsn (const MachineInstr *MI)
 Return Label preceding the instruction. More...
 
MCSymbolgetLabelAfterInsn (const MachineInstr *MI)
 Return Label immediately following the instruction. More...
 
const MCExprgetFunctionLocalOffsetAfterInsn (const MachineInstr *MI)
 Return the function-local offset of an instruction. More...
 
- Public Member Functions inherited from llvm::AsmPrinterHandler
virtual ~AsmPrinterHandler ()
 Pin vtable to this file. More...
 
virtual void markFunctionEnd ()
 
virtual void beginFragment (const MachineBasicBlock *MBB, ExceptionSymbolProvider ESP)
 
virtual void endFragment ()
 
virtual void beginFunclet (const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr)
 Emit target-specific EH funclet machinery. More...
 
virtual void endFunclet ()
 

Protected Member Functions

void beginFunctionImpl (const MachineFunction *MF) override
 Gather pre-function debug information. More...
 
void endFunctionImpl (const MachineFunction *MF) override
 Post process after all instructions in this function are processed. More...
 
- 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. More...
 
void requestLabelBeforeInsn (const MachineInstr *MI)
 Ensure that a label will be emitted before MI. More...
 
void requestLabelAfterInsn (const MachineInstr *MI)
 Ensure that a label will be emitted after MI. More...
 
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. More...
 
- Protected Attributes inherited from llvm::DebugHandlerBase
AsmPrinterAsm
 Target of debug info emission. More...
 
MachineModuleInfoMMI
 Collected machine module information. More...
 
DebugLoc PrevInstLoc
 Previous instruction's location information. More...
 
MCSymbolPrevLabel = nullptr
 
const MachineBasicBlockPrevInstBB = nullptr
 
DebugLoc PrologEndLoc
 This location indicates end of function prologue and beginning of function body. More...
 
const MachineInstrCurMI = nullptr
 If nonnull, stores the current machine instruction we're processing. More...
 
LexicalScopes LScopes
 
DbgValueHistoryMap DbgValues
 History of DBG_VALUE and clobber instructions for each user variable. More...
 
DbgLabelInstrMap DbgLabels
 Mapping of inlined labels and DBG_LABEL machine instruction. More...
 
DenseMap< const MachineInstr *, MCSymbol * > LabelsBeforeInsn
 Maps instruction with label emitted before instruction. More...
 
DenseMap< const MachineInstr *, MCSymbol * > LabelsAfterInsn
 Maps instruction with label emitted after instruction. More...
 

Detailed Description

Collect and emit BTF information.

Definition at line 235 of file BTFDebug.h.

Constructor & Destructor Documentation

◆ BTFDebug()

BTFDebug::BTFDebug ( AsmPrinter AP)

Definition at line 381 of file BTFDebug.cpp.

References llvm::MCStreamer::AddComment(), addString(), llvm::DebugHandlerBase::Asm, llvm::BTF::BPFFieldRelocSize, llvm::BTF::BPFFuncInfoSize, llvm::BTF::BPFLineInfoSize, llvm::BTFLineInfo::ColumnNum, llvm::dyn_cast(), E, llvm::MCStreamer::EmitBytes(), llvm::MCStreamer::EmitIntValue(), llvm::AsmPrinter::EmitLabelReference(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::BTF::ExtHeaderSize, File, llvm::BTFLineInfo::FileNameOff, llvm::StringMap< ValueTy, AllocatorTy >::find(), Fixup, llvm::DICompositeType::getBaseType(), llvm::MCStreamer::getContext(), llvm::DISubrange::getCount(), llvm::DICompositeType::getElements(), llvm::MCContext::getELFSection(), llvm::DIBasicType::getEncoding(), llvm::MemoryBuffer::getFile(), llvm::DIScope::getFile(), llvm::MemoryBuffer::getMemBufferCopy(), llvm::DIType::getName(), llvm::DIType::getOffsetInBits(), llvm::ConstantInt::getSExtValue(), llvm::BTFStringTable::getSize(), llvm::DIType::getSizeInBits(), llvm::BTFStringTable::getTable(), llvm::DINode::getTag(), llvm::DISubroutineType::getTypeArray(), llvm::BTF::HeaderSize, I, llvm::DIType::isForwardDecl(), llvm::BTFLineInfo::Label, llvm::BTFLineInfo::LineNum, llvm::BTFLineInfo::LineOff, llvm_unreachable, llvm::BTF::MAGIC, llvm::BTF::MAX_VLEN, llvm::BTF::SecFieldRelocSize, llvm::BTF::SecFuncInfoSize, llvm::BTF::SecLineInfoSize, llvm::ELF::SHT_PROGBITS, llvm::DITypeRefArray::size(), llvm::size(), llvm::Sched::Source, llvm::MCStreamer::SwitchSection(), llvm::Tag, llvm::to_string(), llvm::Twine::utohexstr(), and llvm::BTF::VERSION.

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

◆ endModule()

void BTFDebug::endModule ( )
overridevirtual

Complete all the types and emit the BTF sections.

Implements llvm::AsmPrinterHandler.

Definition at line 1142 of file BTFDebug.cpp.

References Fixup, llvm::StructType::getName(), and llvm::AMDGPU::HSAMD::Kernel::Arg::Key::TypeName.

◆ getArrayIndexTypeId()

uint32_t llvm::BTFDebug::getArrayIndexTypeId ( )
inline

Get the special array index type id.

Definition at line 329 of file BTFDebug.h.

References assert().

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

◆ getTypeId()

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

Get the type id for a particular DIType.

Definition at line 338 of file BTFDebug.h.

References assert().

Referenced by llvm::BTFTypeDerived::completeType(), llvm::BTFTypeStruct::completeType(), and llvm::BTFTypeFuncProto::completeType().

◆ InstLower()

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

◆ setSymbolSize()

void llvm::BTFDebug::setSymbolSize ( const MCSymbol Sym,
uint64_t  Size 
)
inlineoverridevirtual

For symbols that have a size designated (e.g.

common symbols), this tracks that size.

Implements llvm::AsmPrinterHandler.

Definition at line 345 of file BTFDebug.h.


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