LLDB mainline
lldb_private::Type Class Reference

#include <Type.h>

Inheritance diagram for lldb_private::Type:
[legend]

Classes

struct  ParsedName

Public Types

enum  EncodingDataType {
  eEncodingInvalid , eEncodingIsUID , eEncodingIsConstUID , eEncodingIsRestrictUID ,
  eEncodingIsVolatileUID , eEncodingIsTypedefUID , eEncodingIsPointerUID , eEncodingIsLValueReferenceUID ,
  eEncodingIsRValueReferenceUID , eEncodingIsAtomicUID , eEncodingIsSyntheticUID , eEncodingIsLLVMPtrAuthUID
}
enum class  ResolveState : unsigned char { Unresolved = 0 , Forward = 1 , Layout = 2 , Full = 3 }
typedef uint32_t Payload

Public Member Functions

void Dump (Stream *s, bool show_context, lldb::DescriptionLevel level=lldb::eDescriptionLevelFull)
void DumpTypeName (Stream *s)
lldb::ModuleSP GetModule ()
 Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sure the module is still around before playing with Type instances.
lldb::ModuleSP GetExeModule ()
 GetModule may return module for compile unit's object file.
void GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
SymbolFileGetSymbolFile ()
const SymbolFileGetSymbolFile () const
ConstString GetName ()
ConstString GetBaseName ()
llvm::Expected< uint64_t > GetByteSize (ExecutionContextScope *exe_scope)
llvm::Expected< uint32_t > GetNumChildren (bool omit_empty_base_classes)
bool IsAggregateType ()
bool IsTemplateType ()
bool IsValidType ()
bool IsTypedef ()
lldb::TypeSP GetTypedefType ()
ConstString GetName () const
ConstString GetQualifiedName ()
bool ReadFromMemory (ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
bool WriteToMemory (ExecutionContext *exe_ctx, lldb::addr_t address, AddressType address_type, DataExtractor &data)
lldb::Format GetFormat ()
lldb::Encoding GetEncoding (uint64_t &count)
SymbolContextScopeGetSymbolContextScope ()
const SymbolContextScopeGetSymbolContextScope () const
void SetSymbolContextScope (SymbolContextScope *context)
const lldb_private::DeclarationGetDeclaration () const
CompilerType GetFullCompilerType ()
CompilerType GetLayoutCompilerType ()
CompilerType GetForwardCompilerType ()
void SetEncodingType (Type *encoding_type)
uint32_t GetEncodingMask ()
Payload GetPayload ()
 Return the language-specific payload.
void SetPayload (Payload opaque_payload)
 Return the language-specific payload.
Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID.
 ~UserID ()=default
 Destructor.
void Clear ()
 Clears the object state.
lldb::user_id_t GetID () const
 Get accessor for the user ID.
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.

Static Public Member Functions

static int Compare (const Type &a, const Type &b)
static std::optional< ParsedNameGetTypeScopeAndBasename (llvm::StringRef name)

Protected Member Functions

TypeGetEncodingType ()
bool ResolveCompilerType (ResolveState compiler_type_resolve_state)

Protected Attributes

ConstString m_name
SymbolFilem_symbol_file = nullptr
SymbolContextScopem_context = nullptr
 The symbol context in which this type is defined.
Typem_encoding_type = nullptr
lldb::user_id_t m_encoding_uid = LLDB_INVALID_UID
EncodingDataType m_encoding_uid_type = eEncodingInvalid
uint64_t m_byte_size: 63
uint64_t m_byte_size_has_value: 1
Declaration m_decl
CompilerType m_compiler_type
ResolveState m_compiler_type_resolve_state = ResolveState::Unresolved
Payload m_payload
 Language-specific flags.
Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.

Private Member Functions

 Type (lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name, std::optional< uint64_t > byte_size, SymbolContextScope *context, lldb::user_id_t encoding_uid, EncodingDataType encoding_uid_type, const Declaration &decl, const CompilerType &compiler_qual_type, ResolveState compiler_type_resolve_state, uint32_t opaque_payload=0)
 Type ()
 Type (Type &t)=default
 Type (Type &&t)=default
Typeoperator= (const Type &t)=default
Typeoperator= (Type &&t)=default

Friends

class lldb_private::SymbolFileCommon
 Only allow Symbol File to create types, as they should own them by keeping them in their TypeList.

Detailed Description

Definition at line 417 of file Type.h.

Member Typedef Documentation

◆ Payload

typedef uint32_t lldb_private::Type::Payload

Definition at line 570 of file Type.h.

Member Enumeration Documentation

◆ EncodingDataType

Enumerator
eEncodingInvalid 

Invalid encoding.

eEncodingIsUID 

This type is the type whose UID is m_encoding_uid.

eEncodingIsConstUID 

This type is the type whose UID is m_encoding_uid with the const qualifier added.

eEncodingIsRestrictUID 

This type is the type whose UID is m_encoding_uid with the restrict qualifier added.

eEncodingIsVolatileUID 

This type is the type whose UID is m_encoding_uid with the volatile qualifier added.

eEncodingIsTypedefUID 

This type is alias to a type whose UID is m_encoding_uid.

eEncodingIsPointerUID 

This type is pointer to a type whose UID is m_encoding_uid.

eEncodingIsLValueReferenceUID 

This type is L value reference to a type whose UID is m_encoding_uid.

eEncodingIsRValueReferenceUID 

This type is R value reference to a type whose UID is m_encoding_uid.

eEncodingIsAtomicUID 

This type is the type whose UID is m_encoding_uid as an atomic type.

eEncodingIsSyntheticUID 

This type is the synthetic type whose UID is m_encoding_uid.

eEncodingIsLLVMPtrAuthUID 

This type is a signed pointer.

Definition at line 419 of file Type.h.

◆ ResolveState

enum class lldb_private::Type::ResolveState : unsigned char
strong
Enumerator
Unresolved 
Forward 
Layout 
Full 

Definition at line 449 of file Type.h.

Constructor & Destructor Documentation

◆ Type() [1/4]

Type::Type ( lldb::user_id_t uid,
SymbolFile * symbol_file,
ConstString name,
std::optional< uint64_t > byte_size,
SymbolContextScope * context,
lldb::user_id_t encoding_uid,
EncodingDataType encoding_uid_type,
const Declaration & decl,
const CompilerType & compiler_qual_type,
ResolveState compiler_type_resolve_state,
uint32_t opaque_payload = 0 )
private

◆ Type() [2/4]

Type::Type ( )
private

◆ Type() [3/4]

lldb_private::Type::Type ( Type & t)
privatedefault

References Type().

◆ Type() [4/4]

lldb_private::Type::Type ( Type && t)
privatedefault

References Type().

Member Function Documentation

◆ Compare()

int lldb_private::Type::Compare ( const Type & a,
const Type & b )
static

References Type().

◆ Dump()

◆ DumpTypeName()

void Type::DumpTypeName ( Stream * s)

Definition at line 451 of file Type.cpp.

References lldb_private::ConstString::Dump(), and GetName().

Referenced by lldb_private::Variable::Dump().

◆ GetBaseName()

ConstString Type::GetBaseName ( )

◆ GetByteSize()

◆ GetDeclaration()

const Declaration & Type::GetDeclaration ( ) const

Definition at line 584 of file Type.cpp.

References m_decl.

Referenced by lldb_private::Block::AddRange().

◆ GetDescription()

◆ GetEncoding()

lldb::Encoding Type::GetEncoding ( uint64_t & count)

◆ GetEncodingMask()

uint32_t Type::GetEncodingMask ( )

Definition at line 763 of file Type.cpp.

References GetEncodingMask(), GetEncodingType(), m_encoding_uid_type, and Type().

Referenced by GetCXXMethodCVQuals(), and GetEncodingMask().

◆ GetEncodingType()

Type * Type::GetEncodingType ( )
protected

◆ GetExeModule()

ModuleSP Type::GetExeModule ( )

GetModule may return module for compile unit's object file.

GetExeModule returns module for executable object file that contains compile unit where type was actually defined. GetModule and GetExeModule may return the same value.

Definition at line 857 of file Type.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), and m_compiler_type.

◆ GetFormat()

lldb::Format Type::GetFormat ( )

Definition at line 532 of file Type.cpp.

References lldb_private::CompilerType::GetFormat(), and GetForwardCompilerType().

◆ GetForwardCompilerType()

◆ GetFullCompilerType()

◆ GetLayoutCompilerType()

◆ GetModule()

ModuleSP Type::GetModule ( )

Since Type instances only keep a "SymbolFile *" internally, other classes like TypeImpl need make sure the module is still around before playing with Type instances.

They can store a weak pointer to the Module;

Definition at line 851 of file Type.cpp.

References m_symbol_file.

◆ GetName() [1/2]

◆ GetName() [2/2]

ConstString lldb_private::Type::GetName ( ) const
inline

Definition at line 498 of file Type.h.

References m_name.

◆ GetNumChildren()

llvm::Expected< uint32_t > Type::GetNumChildren ( bool omit_empty_base_classes)

◆ GetPayload()

Payload lldb_private::Type::GetPayload ( )
inline

Return the language-specific payload.

Definition at line 572 of file Type.h.

References m_payload.

◆ GetQualifiedName()

◆ GetSymbolContextScope() [1/2]

SymbolContextScope * lldb_private::Type::GetSymbolContextScope ( )
inline

Definition at line 512 of file Type.h.

References m_context.

◆ GetSymbolContextScope() [2/2]

const SymbolContextScope * lldb_private::Type::GetSymbolContextScope ( ) const
inline

Definition at line 513 of file Type.h.

References m_context.

◆ GetSymbolFile() [1/2]

SymbolFile * lldb_private::Type::GetSymbolFile ( )
inline

◆ GetSymbolFile() [2/2]

const SymbolFile * lldb_private::Type::GetSymbolFile ( ) const
inline

Definition at line 477 of file Type.h.

References m_symbol_file.

◆ GetTypedefType()

lldb::TypeSP Type::GetTypedefType ( )

Definition at line 522 of file Type.cpp.

References IsTypedef(), m_encoding_uid, m_symbol_file, and Type().

◆ GetTypeScopeAndBasename()

◆ IsAggregateType()

bool Type::IsAggregateType ( )

◆ IsTemplateType()

bool Type::IsTemplateType ( )

◆ IsTypedef()

bool lldb_private::Type::IsTypedef ( )
inline

Definition at line 494 of file Type.h.

References eEncodingIsTypedefUID, and m_encoding_uid_type.

Referenced by GetTypedefType().

◆ IsValidType()

bool lldb_private::Type::IsValidType ( )
inline

Definition at line 492 of file Type.h.

References eEncodingInvalid, and m_encoding_uid_type.

◆ operator=() [1/2]

Type & lldb_private::Type::operator= ( const Type & t)
privatedefault

References Type().

◆ operator=() [2/2]

Type & lldb_private::Type::operator= ( Type && t)
privatedefault

References Type().

◆ ReadFromMemory()

◆ ResolveCompilerType()

◆ SetEncodingType()

void lldb_private::Type::SetEncodingType ( Type * encoding_type)
inline

Definition at line 566 of file Type.h.

References m_encoding_type, and Type().

◆ SetPayload()

void lldb_private::Type::SetPayload ( Payload opaque_payload)
inline

Return the language-specific payload.

Definition at line 574 of file Type.h.

References m_payload.

◆ SetSymbolContextScope()

void lldb_private::Type::SetSymbolContextScope ( SymbolContextScope * context)
inline

Definition at line 514 of file Type.h.

References m_context.

◆ WriteToMemory()

bool Type::WriteToMemory ( ExecutionContext * exe_ctx,
lldb::addr_t address,
AddressType address_type,
DataExtractor & data )

Definition at line 579 of file Type.cpp.

◆ lldb_private::SymbolFileCommon

friend class lldb_private::SymbolFileCommon
friend

Only allow Symbol File to create types, as they should own them by keeping them in their TypeList.

See also
SymbolFileCommon::MakeType() reference in the header documentation here so users will know what function to use if the get a compile error.

Definition at line 600 of file Type.h.

Member Data Documentation

◆ m_byte_size

uint64_t lldb_private::Type::m_byte_size
protected

Definition at line 584 of file Type.h.

Referenced by Dump(), GetByteSize(), GetDescription(), Type(), and Type().

◆ m_byte_size_has_value

uint64_t lldb_private::Type::m_byte_size_has_value
protected

Definition at line 585 of file Type.h.

Referenced by Dump(), GetByteSize(), Type(), and Type().

◆ m_compiler_type

CompilerType lldb_private::Type::m_compiler_type
protected

◆ m_compiler_type_resolve_state

ResolveState lldb_private::Type::m_compiler_type_resolve_state = ResolveState::Unresolved
protected

Definition at line 588 of file Type.h.

Referenced by ResolveCompilerType(), and Type().

◆ m_context

SymbolContextScope* lldb_private::Type::m_context = nullptr
protected

The symbol context in which this type is defined.

Definition at line 580 of file Type.h.

Referenced by Dump(), GetSymbolContextScope(), GetSymbolContextScope(), SetSymbolContextScope(), and Type().

◆ m_decl

Declaration lldb_private::Type::m_decl
protected

Definition at line 586 of file Type.h.

Referenced by Dump(), GetDeclaration(), GetDescription(), and Type().

◆ m_encoding_type

Type* lldb_private::Type::m_encoding_type = nullptr
protected

Definition at line 581 of file Type.h.

Referenced by GetEncodingType(), and SetEncodingType().

◆ m_encoding_uid

lldb::user_id_t lldb_private::Type::m_encoding_uid = LLDB_INVALID_UID
protected

Definition at line 582 of file Type.h.

Referenced by Dump(), GetDescription(), GetEncodingType(), GetTypedefType(), ResolveCompilerType(), and Type().

◆ m_encoding_uid_type

EncodingDataType lldb_private::Type::m_encoding_uid_type = eEncodingInvalid
protected

◆ m_name

ConstString lldb_private::Type::m_name
protected

Definition at line 577 of file Type.h.

Referenced by Dump(), GetName(), GetName(), ResolveCompilerType(), Type(), and Type().

◆ m_payload

Payload lldb_private::Type::m_payload
protected

Language-specific flags.

Definition at line 590 of file Type.h.

Referenced by GetPayload(), ResolveCompilerType(), SetPayload(), Type(), and Type().

◆ m_symbol_file

SymbolFile* lldb_private::Type::m_symbol_file = nullptr
protected

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