LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lldb_private::Type Class Reference

#include <Type.h>

Inheritance diagram for lldb_private::Type:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::Type:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 Type (lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name, llvm::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 ()
 
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. More...
 
lldb::ModuleSP GetExeModule ()
 GetModule may return module for compile unit's object file. More...
 
void GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name, ExecutionContextScope *exe_scope)
 
SymbolFileGetSymbolFile ()
 
const SymbolFileGetSymbolFile () const
 
ConstString GetName ()
 
llvm::Optional< uint64_t > GetByteSize (ExecutionContextScope *exe_scope)
 
uint32_t GetNumChildren (bool omit_empty_base_classes)
 
bool IsAggregateType ()
 
bool IsValidType ()
 
bool IsTypedef ()
 
lldb::TypeSP GetTypedefType ()
 
ConstString GetName () const
 
ConstString GetQualifiedName ()
 
void DumpValue (ExecutionContext *exe_ctx, Stream *s, const DataExtractor &data, uint32_t data_offset, bool show_type, bool show_summary, bool verbose, lldb::Format format=lldb::eFormatDefault)
 
bool DumpValueInMemory (ExecutionContext *exe_ctx, Stream *s, lldb::addr_t address, AddressType address_type, bool show_types, bool show_summary, bool verbose)
 
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)
 
bool GetIsDeclaration () const
 
void SetIsDeclaration (bool b)
 
bool GetIsExternal () const
 
void SetIsExternal (bool b)
 
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. More...
 
void SetPayload (Payload opaque_payload)
 Return the language-specific payload. More...
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID. More...
 
 ~UserID ()=default
 Destructor. More...
 
void Clear ()
 Clears the object state. More...
 
lldb::user_id_t GetID () const
 Get accessor for the user ID. More...
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID. More...
 

Static Public Member Functions

static int Compare (const Type &a, const Type &b)
 
static bool GetTypeScopeAndBasename (const llvm::StringRef &name, llvm::StringRef &scope, llvm::StringRef &basename, lldb::TypeClass &type_class)
 

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. More...
 
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. More...
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object. More...
 

Detailed Description

Definition at line 66 of file Type.h.

Member Typedef Documentation

◆ Payload

Definition at line 208 of file Type.h.

Member Enumeration Documentation

◆ EncodingDataType

Enumerator
eEncodingInvalid 
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 pointer 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 

Definition at line 68 of file Type.h.

◆ ResolveState

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

Definition at line 90 of file Type.h.

Constructor & Destructor Documentation

◆ Type() [1/2]

Type::Type ( lldb::user_id_t  uid,
SymbolFile symbol_file,
ConstString  name,
llvm::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 
)

Definition at line 142 of file Type.cpp.

References m_byte_size, and m_byte_size_has_value.

◆ Type() [2/2]

Type::Type ( )

Definition at line 163 of file Type.cpp.

References m_byte_size, and m_byte_size_has_value.

Member Function Documentation

◆ Compare()

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

◆ Dump()

void Type::Dump ( Stream s,
bool  show_context,
lldb::DescriptionLevel  level = lldb::eDescriptionLevelFull 
)

◆ DumpTypeName()

void Type::DumpTypeName ( Stream s)

Definition at line 307 of file Type.cpp.

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

Referenced by lldb_private::Variable::Dump(), and DumpValue().

◆ DumpValue()

void Type::DumpValue ( ExecutionContext exe_ctx,
Stream s,
const DataExtractor data,
uint32_t  data_offset,
bool  show_type,
bool  show_summary,
bool  verbose,
lldb::Format  format = lldb::eFormatDefault 
)

◆ DumpValueInMemory()

bool Type::DumpValueInMemory ( ExecutionContext exe_ctx,
Stream s,
lldb::addr_t  address,
AddressType  address_type,
bool  show_types,
bool  show_summary,
bool  verbose 
)

◆ GetByteSize()

llvm::Optional< uint64_t > Type::GetByteSize ( ExecutionContextScope exe_scope)

◆ GetDeclaration()

const Declaration & Type::GetDeclaration ( ) const

Definition at line 469 of file Type.cpp.

References m_decl.

Referenced by lldb_private::Block::AddRange(), and lldb_private::Function::GetStartLineSourceInfo().

◆ GetDescription()

void Type::GetDescription ( Stream s,
lldb::DescriptionLevel  level,
bool  show_name,
ExecutionContextScope exe_scope 
)

◆ GetEncoding()

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

◆ GetEncodingMask()

uint32_t Type::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 actualy defined. GetModule and GetExeModule may return the same value.

Definition at line 728 of file Type.cpp.

References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFile::GetObjectFile(), lldb_private::TypeSystem::GetSymbolFile(), lldb_private::CompilerType::GetTypeSystem(), and m_compiler_type.

◆ GetFormat()

lldb::Format Type::GetFormat ( )

Definition at line 401 of file Type.cpp.

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

Referenced by DumpValue().

◆ GetForwardCompilerType()

CompilerType Type::GetForwardCompilerType ( )

◆ GetFullCompilerType()

CompilerType Type::GetFullCompilerType ( )

◆ GetIsDeclaration()

bool lldb_private::Type::GetIsDeclaration ( ) const

◆ GetIsExternal()

bool lldb_private::Type::GetIsExternal ( ) const

◆ GetLayoutCompilerType()

CompilerType Type::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 722 of file Type.cpp.

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

◆ GetName() [1/2]

ConstString Type::GetName ( )

◆ GetName() [2/2]

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

Definition at line 144 of file Type.h.

References m_name.

◆ GetNumChildren()

uint32_t Type::GetNumChildren ( bool  omit_empty_base_classes)

◆ GetPayload()

Payload lldb_private::Type::GetPayload ( )
inline

Return the language-specific payload.

Definition at line 210 of file Type.h.

References m_payload.

◆ GetQualifiedName()

ConstString Type::GetQualifiedName ( )

◆ GetSymbolContextScope() [1/2]

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

Definition at line 175 of file Type.h.

References m_context.

◆ GetSymbolContextScope() [2/2]

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

Definition at line 176 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 128 of file Type.h.

References m_symbol_file.

◆ GetTypedefType()

lldb::TypeSP Type::GetTypedefType ( )

◆ GetTypeScopeAndBasename()

bool Type::GetTypeScopeAndBasename ( const llvm::StringRef &  name,
llvm::StringRef &  scope,
llvm::StringRef &  basename,
lldb::TypeClass &  type_class 
)
static

◆ IsAggregateType()

bool Type::IsAggregateType ( )

◆ IsTypedef()

bool lldb_private::Type::IsTypedef ( )
inline

Definition at line 140 of file Type.h.

References eEncodingIsTypedefUID, and m_encoding_uid_type.

Referenced by GetTypedefType().

◆ IsValidType()

bool lldb_private::Type::IsValidType ( )
inline

Definition at line 138 of file Type.h.

References eEncodingInvalid, and m_encoding_uid_type.

◆ ReadFromMemory()

bool Type::ReadFromMemory ( ExecutionContext exe_ctx,
lldb::addr_t  address,
AddressType  address_type,
DataExtractor data 
)

◆ ResolveCompilerType()

bool Type::ResolveCompilerType ( ResolveState  compiler_type_resolve_state)
protected

◆ SetEncodingType()

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

Definition at line 204 of file Type.h.

References m_encoding_type.

◆ SetIsDeclaration()

void lldb_private::Type::SetIsDeclaration ( bool  b)

◆ SetIsExternal()

void lldb_private::Type::SetIsExternal ( bool  b)

◆ SetPayload()

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

Return the language-specific payload.

Definition at line 212 of file Type.h.

References m_payload.

◆ SetSymbolContextScope()

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

Definition at line 177 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 464 of file Type.cpp.

Member Data Documentation

◆ m_byte_size

uint64_t lldb_private::Type::m_byte_size
protected

Definition at line 222 of file Type.h.

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

◆ m_byte_size_has_value

uint64_t lldb_private::Type::m_byte_size_has_value
protected

Definition at line 223 of file Type.h.

Referenced by Dump(), GetByteSize(), 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 226 of file Type.h.

Referenced by ResolveCompilerType().

◆ m_context

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

The symbol context in which this type is defined.

Definition at line 218 of file Type.h.

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

◆ m_decl

Declaration lldb_private::Type::m_decl
protected

Definition at line 224 of file Type.h.

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

◆ m_encoding_type

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

Definition at line 219 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 220 of file Type.h.

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

◆ 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 215 of file Type.h.

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

◆ m_payload

Payload lldb_private::Type::m_payload
protected

Language-specific flags.

Definition at line 228 of file Type.h.

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

◆ m_symbol_file

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

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