15 #ifndef LLVM_LIB_TARGET_BPF_BTFDEBUG_H 16 #define LLVM_LIB_TARGET_BPF_BTFDEBUG_H 20 #include <unordered_map> 30 class MachineFunction;
91 std::vector<struct BTF::BTFEnum> EnumValues;
118 std::vector<struct BTF::BTFMember> Members;
133 std::unordered_map<uint32_t, StringRef> FuncArgNames;
134 std::vector<struct BTF::BTFParam> Parameters;
138 const std::unordered_map<uint32_t, StringRef> &FuncArgNames);
164 std::unordered_map<uint32_t, uint32_t> OffsetToIdMap;
166 std::vector<std::string> Table;
171 std::vector<std::string> &
getTable() {
return Table; }
195 bool SkipInstruction;
196 bool LineInfoGenerated;
200 std::vector<std::unique_ptr<BTFTypeBase>> TypeEntries;
201 std::unordered_map<const DIType *, uint32_t> DIToIdMap;
202 std::unordered_map<uint32_t, std::vector<BTFFuncInfo>> FuncInfoTable;
203 std::unordered_map<uint32_t, std::vector<BTFLineInfo>> LineInfoTable;
209 void addType(std::unique_ptr<BTFTypeBase> TypeEntry,
const DIType *Ty);
211 uint32_t addType(std::unique_ptr<BTFTypeBase> TypeEntry);
216 void visitTypeEntry(
const DIType *Ty);
218 void visitSubroutineType(
220 const std::unordered_map<uint32_t, StringRef> &FuncArgNames,
239 void emitCommonHeader();
242 void emitBTFSection();
245 void emitBTFExtSection();
260 return ArrayIndexTypeId;
268 assert(Ty &&
"Invalid null Type");
269 assert(DIToIdMap.find(Ty) != DIToIdMap.end() &&
270 "DIType not added in the BDIToIdMap");
271 return DIToIdMap[Ty];
280 void endModule()
override;
Handle struct/union type.
Represent one func and its type id.
virtual ~BTFTypeBase()=default
uint32_t ColumnNum
the column number
This class represents lattice values for constants.
uint32_t getSize()
Get the size of this BTF type entry.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
uint32_t getArrayIndexTypeId()
Get the special array index type id.
uint32_t getSize()
Get the size of this BTF type entry.
uint32_t getSize()
Get the size of this BTF type entry.
The BTF common type definition.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
virtual void emitType(MCStreamer &OS)
Emit types for this BTF type entry.
uint32_t roundupToBytes(uint32_t NumBits)
void setSymbolSize(const MCSymbol *Symbol, uint64_t Size) override
For symbols that have a size designated (e.g.
Streaming machine code generation interface.
struct BTF::CommonType BTFType
Collect and emit BTF information.
This class is intended to be used as a driving class for all asm writers.
constexpr char TypeName[]
Key for Kernel::Arg::Metadata::mTypeName.
std::vector< std::string > & getTable()
uint32_t getSize()
Get the size of this BTF type entry.
uint32_t LineNum
the line number
virtual void completeType(BTFDebug &BDebug)
Complete BTF type generation after all related DebugInfo types have been visited so their BTF type id...
virtual uint32_t getSize()
Get the size of this BTF type entry.
This file contains the layout of .BTF and .BTF.ext ELF sections.
MCSymbol * Label
MCSymbol identifying insn for the lineinfo.
uint32_t getTypeId(const DIType *Ty)
Get the type id for a particular DIType.
The base class for BTF type generation.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
BTF_KIND_ARRAY is followed by one "struct BTFArray".
Type array for a subprogram.
Representation of each machine instruction.
uint32_t addString(StringRef S)
Add a string to the string table and returns its offset in the table.
uint32_t getSize()
Get the size of this BTF type entry.
Base class for debug information backends.
const MCSymbol * Label
Func MCSymbol.
uint32_t FileNameOff
file name offset in the .BTF string table
size_t addString(StringRef S)
Add string to the string table.
Handle several derived types include pointer, const, volatile, typedef and restrict.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Handle struct or union forward declaration.
StringRef - Represent a constant reference to a string, i.e.
uint32_t TypeId
Type id referring to .BTF type section.
uint32_t LineOff
line offset in the .BTF string table
uint32_t getSize()
Get the size of this BTF type entry.
Basic type, like 'int' or 'float'.