LLDB mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::TypeAndOrName Class Reference

Sometimes you can find the name of the type corresponding to an object, but we don't have debug information for it. More...

#include <Type.h>

Public Member Functions

 TypeAndOrName ()=default
 
 TypeAndOrName (lldb::TypeSP &type_sp)
 
 TypeAndOrName (const CompilerType &compiler_type)
 
 TypeAndOrName (const char *type_str)
 
 TypeAndOrName (ConstString &type_const_string)
 
bool operator== (const TypeAndOrName &other) const
 
bool operator!= (const TypeAndOrName &other) const
 
ConstString GetName () const
 
CompilerType GetCompilerType () const
 
void SetName (ConstString type_name)
 
void SetName (const char *type_name_cstr)
 
void SetName (llvm::StringRef name)
 
void SetTypeSP (lldb::TypeSP type_sp)
 
void SetCompilerType (CompilerType compiler_type)
 
bool IsEmpty () const
 
bool HasName () const
 
bool HasCompilerType () const
 
bool HasType () const
 
void Clear ()
 
 operator bool ()
 

Private Attributes

CompilerType m_compiler_type
 
ConstString m_type_name
 

Detailed Description

Sometimes you can find the name of the type corresponding to an object, but we don't have debug information for it.

If that is the case, you can return one of these objects, and then if it has a full type, you can use that, but if not at least you can print the name for informational purposes.

Definition at line 745 of file Type.h.

Constructor & Destructor Documentation

◆ TypeAndOrName() [1/5]

lldb_private::TypeAndOrName::TypeAndOrName ( )
default

◆ TypeAndOrName() [2/5]

TypeAndOrName::TypeAndOrName ( lldb::TypeSP type_sp)

Definition at line 833 of file Type.cpp.

References m_compiler_type, and m_type_name.

◆ TypeAndOrName() [3/5]

lldb_private::TypeAndOrName::TypeAndOrName ( const CompilerType compiler_type)

◆ TypeAndOrName() [4/5]

TypeAndOrName::TypeAndOrName ( const char *  type_str)

Definition at line 840 of file Type.cpp.

◆ TypeAndOrName() [5/5]

TypeAndOrName::TypeAndOrName ( ConstString type_const_string)

Definition at line 843 of file Type.cpp.

Member Function Documentation

◆ Clear()

void TypeAndOrName::Clear ( )

◆ GetCompilerType()

CompilerType lldb_private::TypeAndOrName::GetCompilerType ( ) const
inline

◆ GetName()

ConstString TypeAndOrName::GetName ( ) const

◆ HasCompilerType()

bool TypeAndOrName::HasCompilerType ( ) const

Definition at line 903 of file Type.cpp.

References lldb_private::CompilerType::IsValid(), and m_compiler_type.

Referenced by HasType().

◆ HasName()

bool TypeAndOrName::HasName ( ) const

◆ HasType()

bool lldb_private::TypeAndOrName::HasType ( ) const
inline

◆ IsEmpty()

bool TypeAndOrName::IsEmpty ( ) const

◆ operator bool()

lldb_private::TypeAndOrName::operator bool ( )
inlineexplicit

Definition at line 781 of file Type.h.

References IsEmpty().

◆ operator!=()

bool TypeAndOrName::operator!= ( const TypeAndOrName other) const

Definition at line 854 of file Type.cpp.

◆ operator==()

bool TypeAndOrName::operator== ( const TypeAndOrName other) const

Definition at line 846 of file Type.cpp.

References m_compiler_type, and m_type_name.

◆ SetCompilerType()

void TypeAndOrName::SetCompilerType ( CompilerType  compiler_type)

◆ SetName() [1/3]

void TypeAndOrName::SetName ( const char *  type_name_cstr)

Definition at line 870 of file Type.cpp.

References m_type_name, and lldb_private::ConstString::SetCString().

◆ SetName() [2/3]

void TypeAndOrName::SetName ( ConstString  type_name)

◆ SetName() [3/3]

void TypeAndOrName::SetName ( llvm::StringRef  name)

Definition at line 874 of file Type.cpp.

References m_type_name, and lldb_private::ConstString::SetString().

◆ SetTypeSP()

void TypeAndOrName::SetTypeSP ( lldb::TypeSP  type_sp)

Member Data Documentation

◆ m_compiler_type

CompilerType lldb_private::TypeAndOrName::m_compiler_type
private

◆ m_type_name

ConstString lldb_private::TypeAndOrName::m_type_name
private

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