LLDB
mainline
|
Represents a generic declaration context in a program. More...
#include <CompilerDeclContext.h>
Public Member Functions | |
CompilerDeclContext ()=default | |
Constructs an invalid CompilerDeclContext. More... | |
CompilerDeclContext (TypeSystem *type_system, void *decl_ctx) | |
Constructs a CompilerDeclContext with the given opaque decl context and its respective TypeSystem instance. More... | |
operator bool () const | |
bool | operator< (const CompilerDeclContext &rhs) const |
bool | IsValid () const |
std::vector< CompilerDecl > | FindDeclByName (ConstString name, const bool ignore_using_decls) |
bool | IsClassMethod (lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr) |
Checks if this decl context represents a method of a class. More... | |
bool | IsContainedInLookup (CompilerDeclContext other) const |
Check if the given other decl context is contained in the lookup of this decl context (for example because the other context is a nested inline namespace). More... | |
TypeSystem * | GetTypeSystem () const |
void * | GetOpaqueDeclContext () const |
void | SetDeclContext (TypeSystem *type_system, void *decl_ctx) |
void | Clear () |
ConstString | GetName () const |
ConstString | GetScopeQualifiedName () const |
Private Attributes | |
TypeSystem * | m_type_system = nullptr |
void * | m_opaque_decl_ctx = nullptr |
Represents a generic declaration context in a program.
A declaration context is data structure that contains declarations (e.g. namespaces).
This class serves as an abstraction for a declaration context 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 30 of file CompilerDeclContext.h.
|
default |
Constructs an invalid CompilerDeclContext.
|
inline |
Constructs a CompilerDeclContext with the given opaque decl context and its respective TypeSystem instance.
This constructor should only be called from the respective TypeSystem implementation.
Definition at line 42 of file CompilerDeclContext.h.
|
inline |
Definition at line 110 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
std::vector< CompilerDecl > CompilerDeclContext::FindDeclByName | ( | ConstString | name, |
const bool | ignore_using_decls | ||
) |
Definition at line 17 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextFindDeclByName(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::ClangExpressionDeclMap::LookupLocalVariable().
ConstString CompilerDeclContext::GetName | ( | ) | const |
Definition at line 25 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextGetName(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), SymbolFileDWARF::FindNamespace(), and lldb_private::TypeMemberFunctionImpl::GetDescription().
|
inline |
Definition at line 103 of file CompilerDeclContext.h.
References m_opaque_decl_ctx.
Referenced by lldb_private::TypeSystemClang::DeclContextGetAsCXXMethodDecl(), lldb_private::TypeSystemClang::DeclContextGetAsDeclContext(), lldb_private::TypeSystemClang::DeclContextGetAsFunctionDecl(), lldb_private::TypeSystemClang::DeclContextGetAsNamespaceDecl(), lldb_private::TypeSystemClang::DeclContextGetAsObjCMethodDecl(), DWARFASTParserClang::EnsureAllDIEsInDeclContextHaveBeenParsed(), SymbolFilePDB::FindNamespace(), SymbolFileDWARF::FindNamespace(), lldb_private::npdb::PdbAstBuilder::FromCompilerDeclContext(), DWARFASTParserClang::GetDeclContextForBlock(), lldb_private::operator!=(), lldb_private::operator==(), SymbolFilePDB::ParseDeclsForContext(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
ConstString CompilerDeclContext::GetScopeQualifiedName | ( | ) | const |
Definition at line 31 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextGetScopeQualifiedName(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by SymbolFileDWARF::ParseType().
|
inline |
Definition at line 101 of file CompilerDeclContext.h.
References m_type_system.
Referenced by lldb_private::TypeSystemClang::DeclContextGetMetaData(), lldb_private::TypeSystemClang::DeclContextGetTypeSystemClang(), SymbolFilePDB::DeclContextMatchesThisSymbolFile(), SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFileDWARF::FindNamespace(), lldb_private::ClangExpressionDeclMap::GetTypeSystemClang(), IsClangDeclContext(), lldb_private::ClangExpressionDeclMap::LookUpLldbClass(), lldb_private::ClangExpressionDeclMap::LookUpLldbObjCClass(), lldb_private::ClangExpressionDeclMap::LookupLocalVarNamespace(), lldb_private::operator!=(), lldb_private::operator==(), SymbolFileDWARF::ParseDeclsForContext(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
bool CompilerDeclContext::IsClassMethod | ( | lldb::LanguageType * | language_ptr, |
bool * | is_instance_method_ptr, | ||
ConstString * | language_object_name_ptr | ||
) |
Checks if this decl context represents a method of a class.
[out] | language_ptr | If non NULL and true is returned from this function, this will indicate if the language that respresents the method. |
[out] | is_instance_method_ptr | If non NULL and true is returned from this function, this will indicate if the method is an instance function (true) or a class method (false indicating the function is static, or doesn't require an instance of the class to be called). |
[out] | language_object_name_ptr | If non NULL and true is returned from this function, this will indicate if implicit object name for the language like "this" for C++, and "self" for Objective C. |
Definition at line 37 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextIsClassMethod(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::SymbolContext::GetFunctionMethodInfo(), lldb_private::ClangExpressionDeclMap::LookupFunction(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
bool CompilerDeclContext::IsContainedInLookup | ( | CompilerDeclContext | other | ) | const |
Check if the given other decl context is contained in the lookup of this decl context (for example because the other context is a nested inline namespace).
[in] | other | The other decl context for which we should check if it is contained in the lookoup of this context. |
Definition at line 47 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextIsContainedInLookup(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by SymbolFileDWARF::DIEInDeclContext().
|
inline |
Definition at line 55 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
Referenced by SymbolFilePDB::DeclContextMatchesThisSymbolFile(), SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFileDWARF::DIEInDeclContext(), FindDeclByName(), SymbolFilePDB::FindGlobalVariables(), SymbolFileDWARF::FindNamespace(), SymbolFilePDB::FindTypesByName(), lldb_private::ManualDWARFIndex::GetFunctions(), GetName(), GetScopeQualifiedName(), IsClangDeclContext(), IsClassMethod(), IsContainedInLookup(), lldb_private::ClangExpressionDeclMap::LookupLocalVariable(), operator bool(), and lldb_private::DWARFIndex::ProcessFunctionDIE().
|
inlineexplicit |
Definition at line 47 of file CompilerDeclContext.h.
References IsValid().
|
inline |
Definition at line 49 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
|
inline |
Definition at line 105 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
|
private |
Definition at line 121 of file CompilerDeclContext.h.
Referenced by Clear(), FindDeclByName(), GetName(), GetOpaqueDeclContext(), GetScopeQualifiedName(), IsClassMethod(), IsContainedInLookup(), IsValid(), operator<(), and SetDeclContext().
|
private |
Definition at line 120 of file CompilerDeclContext.h.
Referenced by Clear(), FindDeclByName(), GetName(), GetScopeQualifiedName(), GetTypeSystem(), IsClassMethod(), IsContainedInLookup(), IsValid(), operator<(), and SetDeclContext().