LLDB mainline
Public Member Functions | Private Attributes | List of all members
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

◆ 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.

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 lldb_private::TypeSystem::DeclGetCompilerContext(), m_opaque_decl, and m_type_system.

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

◆ GetConstantValue()

Scalar CompilerDecl::GetConstantValue ( ) const

◆ GetDeclContext()

CompilerDeclContext CompilerDecl::GetDeclContext ( ) const

◆ GetFunctionArgumentType()

CompilerType CompilerDecl::GetFunctionArgumentType ( size_t  arg_idx) const

◆ GetFunctionReturnType()

CompilerType CompilerDecl::GetFunctionReturnType ( ) const

◆ GetMangledName()

ConstString CompilerDecl::GetMangledName ( ) const

◆ GetName()

ConstString CompilerDecl::GetName ( ) const

◆ GetNumFunctionArguments()

size_t CompilerDecl::GetNumFunctionArguments ( ) const

◆ GetOpaqueDecl()

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

◆ GetType()

CompilerType CompilerDecl::GetType ( ) const

◆ 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 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

void* lldb_private::CompilerDecl::m_opaque_decl = nullptr
private

◆ m_type_system

TypeSystem* lldb_private::CompilerDecl::m_type_system = nullptr
private

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