LLVM 22.0.0git
llvm::BTFTypeStruct Class Reference

Handle struct/union type. More...

#include "Target/BPF/BTFDebug.h"

Inheritance diagram for llvm::BTFTypeStruct:
[legend]

Public Member Functions

 BTFTypeStruct (const DICompositeType *STy, bool IsStruct, bool HasBitField, uint32_t NumMembers)
 Represent either a struct or a union.
uint32_t getSize () override
 Get the size of this BTF type entry.
void completeType (BTFDebug &BDebug) override
 Complete BTF type generation after all related DebugInfo types have been visited so their BTF type id's are available for cross referece.
void emitType (MCStreamer &OS) override
 Emit types for this BTF type entry.
std::string getName ()
Public Member Functions inherited from llvm::BTFTypeBase
 BTFTypeBase ()
virtual ~BTFTypeBase ()=default
void setId (uint32_t Id)
uint32_t getId ()
uint32_t roundupToBytes (uint32_t NumBits)

Additional Inherited Members

Protected Attributes inherited from llvm::BTFTypeBase
uint8_t Kind
bool IsCompleted
uint32_t Id
struct BTF::CommonType BTFType

Detailed Description

Handle struct/union type.

Definition at line 126 of file BTFDebug.h.

Constructor & Destructor Documentation

◆ BTFTypeStruct()

BTFTypeStruct::BTFTypeStruct ( const DICompositeType * STy,
bool IsStruct,
bool HasBitField,
uint32_t NumMembers )

Represent either a struct or a union.

Definition at line 289 of file BTFDebug.cpp.

References llvm::BTFTypeBase::BTFType, llvm::BTFTypeBase::Kind, and llvm::BTFTypeBase::roundupToBytes().

Member Function Documentation

◆ completeType()

void BTFTypeStruct::completeType ( BTFDebug & BDebug)
overridevirtual

Complete BTF type generation after all related DebugInfo types have been visited so their BTF type id's are available for cross referece.

Reimplemented from llvm::BTFTypeBase.

Definition at line 297 of file BTFDebug.cpp.

References llvm::BTFDebug::addString(), llvm::BTFTypeBase::BTFType, llvm::cast(), llvm::BTFDebug::getTypeId(), llvm::BTFTypeBase::IsCompleted, llvm::BTF::BTFMember::NameOff, llvm::BTF::BTFMember::Offset, tryRemoveAtomicType(), and llvm::BTF::BTFMember::Type.

◆ emitType()

void BTFTypeStruct::emitType ( MCStreamer & OS)
overridevirtual

Emit types for this BTF type entry.

Emit a BTF common type.

Reimplemented from llvm::BTFTypeBase.

Definition at line 323 of file BTFDebug.cpp.

References llvm::MCStreamer::AddComment(), llvm::MCStreamer::emitInt32(), llvm::BTFTypeBase::emitType(), and llvm::Twine::utohexstr().

◆ getName()

std::string BTFTypeStruct::getName ( )

Definition at line 333 of file BTFDebug.cpp.

◆ getSize()

uint32_t llvm::BTFTypeStruct::getSize ( )
inlineoverridevirtual

Get the size of this BTF type entry.

Reimplemented from llvm::BTFTypeBase.

Definition at line 134 of file BTFDebug.h.

References llvm::BTF::BTFMemberSize, and llvm::BTFTypeBase::getSize().


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