LLDB mainline
lldb_private::CompilerDecl Class Reference

Represents a generic declaration such as a function declaration. More...

#include <CompilerDecl.h>

Public Member Functions

 CompilerDecl ()=default
 CompilerDecl (TypeSystem *type_system, void *decl)
 Creates a CompilerDecl with the given TypeSystem and opaque pointer.
 operator bool () const
bool operator< (const CompilerDecl &rhs) const
bool IsValid () const
TypeSystemGetTypeSystem () const
void * GetOpaqueDecl () const
void SetDecl (TypeSystem *type_system, void *decl)
void Clear ()
ConstString GetName () const
ConstString GetMangledName () const
CompilerDeclContext GetDeclContext () const
CompilerType GetType () const
CompilerType GetFunctionReturnType () const
size_t GetNumFunctionArguments () const
CompilerType GetFunctionArgumentType (size_t arg_idx) const
std::vector< lldb_private::CompilerContextGetCompilerContext () const
 Populate a valid compiler context from the current declaration.
Scalar GetConstantValue () const

Private Attributes

TypeSystemm_type_system = nullptr
void * m_opaque_decl = nullptr

Detailed Description

Represents a generic declaration such as a function declaration.

This class serves as an abstraction for a declaration inside one of the TypeSystems implemented by the language plugins. It does not have any actual logic in it but only stores an opaque pointer and a pointer to the TypeSystem that gives meaning to this opaque pointer. All methods of this class should call their respective method in the TypeSystem interface and pass the opaque pointer along.

See also
lldb_private::TypeSystem

Definition at line 28 of file CompilerDecl.h.

Constructor & Destructor Documentation

◆ CompilerDecl() [1/2]

lldb_private::CompilerDecl::CompilerDecl ( )
default

Referenced by operator<().

◆ CompilerDecl() [2/2]

lldb_private::CompilerDecl::CompilerDecl ( TypeSystem * type_system,
void * decl )
inline

Creates a CompilerDecl with the given TypeSystem and opaque pointer.

This constructor should only be called from the respective TypeSystem implementation.

Definition at line 37 of file CompilerDecl.h.

References m_opaque_decl, and m_type_system.

Member Function Documentation

◆ Clear()

void lldb_private::CompilerDecl::Clear ( )
inline

Definition at line 65 of file CompilerDecl.h.

References m_opaque_decl, and m_type_system.

◆ GetCompilerContext()

std::vector< lldb_private::CompilerContext > CompilerDecl::GetCompilerContext ( ) const

Populate a valid compiler context from the current declaration.

Returns
A valid vector of CompilerContext entries that describes this declaration. The first entry in the vector is the parent of the subsequent entry, so the topmost entry is the global namespace.

Definition at line 57 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

Referenced by lldb_private::TypeQuery::TypeQuery().

◆ GetConstantValue()

Scalar CompilerDecl::GetConstantValue ( ) const

Definition at line 61 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetDeclContext()

CompilerDeclContext CompilerDecl::GetDeclContext ( ) const

Definition at line 24 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetFunctionArgumentType()

CompilerType CompilerDecl::GetFunctionArgumentType ( size_t arg_idx) const

Definition at line 40 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetFunctionReturnType()

CompilerType CompilerDecl::GetFunctionReturnType ( ) const

Definition at line 32 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetMangledName()

ConstString CompilerDecl::GetMangledName ( ) const

Definition at line 20 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetName()

ConstString CompilerDecl::GetName ( ) const

Definition at line 16 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

Referenced by lldb_private::SymbolFileOnDemand::GetDeclForUID().

◆ GetNumFunctionArguments()

size_t CompilerDecl::GetNumFunctionArguments ( ) const

Definition at line 36 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetOpaqueDecl()

void * lldb_private::CompilerDecl::GetOpaqueDecl ( ) const
inline

◆ GetType()

CompilerType CompilerDecl::GetType ( ) const

Definition at line 28 of file CompilerDecl.cpp.

References m_opaque_decl, and m_type_system.

◆ GetTypeSystem()

TypeSystem * lldb_private::CompilerDecl::GetTypeSystem ( ) const
inline

◆ IsValid()

bool lldb_private::CompilerDecl::IsValid ( ) const
inline

Definition at line 50 of file CompilerDecl.h.

References m_opaque_decl, and m_type_system.

Referenced by operator bool().

◆ operator bool()

lldb_private::CompilerDecl::operator bool ( ) const
inlineexplicit

Definition at line 42 of file CompilerDecl.h.

References IsValid().

◆ operator<()

bool lldb_private::CompilerDecl::operator< ( const CompilerDecl & rhs) const
inline

Definition at line 44 of file CompilerDecl.h.

References CompilerDecl(), m_opaque_decl, and m_type_system.

◆ SetDecl()

void lldb_private::CompilerDecl::SetDecl ( TypeSystem * type_system,
void * decl )
inline

Definition at line 60 of file CompilerDecl.h.

References m_opaque_decl, and m_type_system.

Member Data Documentation

◆ m_opaque_decl

◆ m_type_system


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