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>

Collaboration diagram for lldb_private::CompilerDecl:
Collaboration graph
[legend]

Public Member Functions

 CompilerDecl ()=default
 
 CompilerDecl (TypeSystem *type_system, void *decl)
 Creates a CompilerDecl with the given TypeSystem and opaque pointer. More...
 
 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 GetFunctionReturnType () const
 
size_t GetNumFunctionArguments () const
 
CompilerType GetFunctionArgumentType (size_t arg_idx) 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

◆ GetDeclContext()

CompilerDeclContext CompilerDecl::GetDeclContext ( ) const

Definition at line 23 of file CompilerDecl.cpp.

References lldb_private::TypeSystem::DeclGetDeclContext(), m_opaque_decl, and m_type_system.

Referenced by Clear().

◆ GetFunctionArgumentType()

CompilerType CompilerDecl::GetFunctionArgumentType ( size_t  arg_idx) const

◆ GetFunctionReturnType()

CompilerType CompilerDecl::GetFunctionReturnType ( ) const

◆ GetMangledName()

ConstString CompilerDecl::GetMangledName ( ) const

Definition at line 19 of file CompilerDecl.cpp.

References lldb_private::TypeSystem::DeclGetMangledName(), m_opaque_decl, and m_type_system.

Referenced by Clear().

◆ GetName()

ConstString CompilerDecl::GetName ( ) const

Definition at line 15 of file CompilerDecl.cpp.

References lldb_private::TypeSystem::DeclGetName(), m_opaque_decl, and m_type_system.

Referenced by Clear().

◆ GetNumFunctionArguments()

size_t CompilerDecl::GetNumFunctionArguments ( ) const

◆ GetOpaqueDecl()

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

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