LLDB mainline
|
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 |
TypeSystem * | GetTypeSystem () 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::CompilerContext > | GetCompilerContext () const |
Populate a valid compiler context from the current declaration. | |
Scalar | GetConstantValue () const |
Private Attributes | |
TypeSystem * | m_type_system = nullptr |
void * | m_opaque_decl = nullptr |
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.
Definition at line 28 of file CompilerDecl.h.
|
default |
|
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.
|
inline |
Definition at line 65 of file CompilerDecl.h.
References m_opaque_decl, and m_type_system.
std::vector< lldb_private::CompilerContext > CompilerDecl::GetCompilerContext | ( | ) | const |
Populate a valid compiler context from the current declaration.
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().
Scalar CompilerDecl::GetConstantValue | ( | ) | const |
Definition at line 61 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetConstantValue(), m_opaque_decl, and m_type_system.
CompilerDeclContext CompilerDecl::GetDeclContext | ( | ) | const |
Definition at line 24 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetDeclContext(), m_opaque_decl, and m_type_system.
Referenced by lldb_private::TypeMemberFunctionImpl::GetDescription().
CompilerType CompilerDecl::GetFunctionArgumentType | ( | size_t | arg_idx | ) | const |
Definition at line 40 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetFunctionArgumentType(), m_opaque_decl, and m_type_system.
Referenced by lldb_private::TypeMemberFunctionImpl::GetArgumentAtIndex().
CompilerType CompilerDecl::GetFunctionReturnType | ( | ) | const |
Definition at line 32 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetFunctionReturnType(), m_opaque_decl, and m_type_system.
Referenced by lldb_private::TypeMemberFunctionImpl::GetReturnType().
ConstString CompilerDecl::GetMangledName | ( | ) | const |
Definition at line 20 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetMangledName(), m_opaque_decl, and m_type_system.
Referenced by lldb_private::TypeMemberFunctionImpl::GetMangledName().
ConstString CompilerDecl::GetName | ( | ) | const |
Definition at line 16 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetName(), m_opaque_decl, and m_type_system.
Referenced by lldb_private::SymbolFileOnDemand::GetDeclForUID().
size_t CompilerDecl::GetNumFunctionArguments | ( | ) | const |
Definition at line 36 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::DeclGetFunctionNumArguments(), m_opaque_decl, and m_type_system.
Referenced by lldb_private::TypeMemberFunctionImpl::GetNumArguments().
|
inline |
Definition at line 58 of file CompilerDecl.h.
References m_opaque_decl.
Referenced by DWARFASTParserClang::GetClangDeclForDIE(), lldb_private::ClangUtil::GetDecl(), lldb_private::operator!=(), and lldb_private::operator==().
CompilerType CompilerDecl::GetType | ( | ) | const |
Definition at line 28 of file CompilerDecl.cpp.
References lldb_private::TypeSystem::GetTypeForDecl(), m_opaque_decl, and m_type_system.
|
inline |
Definition at line 56 of file CompilerDecl.h.
References m_type_system.
Referenced by lldb_private::ClangUtil::GetDecl(), lldb_private::operator!=(), and lldb_private::operator==().
|
inline |
Definition at line 50 of file CompilerDecl.h.
References m_opaque_decl, and m_type_system.
Referenced by operator bool().
|
inlineexplicit |
Definition at line 42 of file CompilerDecl.h.
References IsValid().
|
inline |
Definition at line 44 of file CompilerDecl.h.
References m_opaque_decl, and m_type_system.
|
inline |
Definition at line 60 of file CompilerDecl.h.
References m_opaque_decl, and m_type_system.
|
private |
Definition at line 103 of file CompilerDecl.h.
Referenced by Clear(), GetCompilerContext(), GetConstantValue(), GetDeclContext(), GetFunctionArgumentType(), GetFunctionReturnType(), GetMangledName(), GetName(), GetNumFunctionArguments(), GetOpaqueDecl(), GetType(), IsValid(), operator<(), and SetDecl().
|
private |
Definition at line 102 of file CompilerDecl.h.
Referenced by Clear(), GetCompilerContext(), GetConstantValue(), GetDeclContext(), GetFunctionArgumentType(), GetFunctionReturnType(), GetMangledName(), GetName(), GetNumFunctionArguments(), GetType(), GetTypeSystem(), IsValid(), operator<(), and SetDecl().