LLDB mainline
|
Represents a generic declaration context in a program. More...
#include <CompilerDeclContext.h>
Public Member Functions | |
CompilerDeclContext ()=default | |
Constructs an invalid CompilerDeclContext. | |
CompilerDeclContext (TypeSystem *type_system, void *decl_ctx) | |
Constructs a CompilerDeclContext with the given opaque decl context and its respective TypeSystem instance. | |
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 () |
Checks if this decl context represents a method of a class. | |
lldb::LanguageType | GetLanguage () |
Determines the original language of the decl context. | |
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). | |
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 96 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().
lldb::LanguageType CompilerDeclContext::GetLanguage | ( | ) |
Determines the original language of the decl context.
Definition at line 43 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextGetLanguage(), IsValid(), m_opaque_decl_ctx, and m_type_system.
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 89 of file CompilerDeclContext.h.
References m_opaque_decl_ctx.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::TypeSystemClang::DeclContextGetAsCXXMethodDecl(), lldb_private::TypeSystemClang::DeclContextGetAsDeclContext(), lldb_private::TypeSystemClang::DeclContextGetAsFunctionDecl(), lldb_private::TypeSystemClang::DeclContextGetAsNamespaceDecl(), lldb_private::TypeSystemClang::DeclContextGetAsObjCMethodDecl(), DWARFASTParserClang::EnsureAllDIEsInDeclContextHaveBeenParsed(), SymbolFileDWARF::FindNamespace(), SymbolFilePDB::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 87 of file CompilerDeclContext.h.
References m_type_system.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::TypeSystemClang::DeclContextGetMetaData(), lldb_private::TypeSystemClang::DeclContextGetTypeSystemClang(), SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFilePDB::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(), lldb_private::npdb::SymbolFileNativePDB::ParseDeclsForContext(), and lldb_private::ClangExpressionDeclMap::SearchFunctionsInSymbolContexts().
bool CompilerDeclContext::IsClassMethod | ( | ) |
Checks if this decl context represents a method of a class.
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::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 49 of file CompilerDeclContext.cpp.
References lldb_private::TypeSystem::DeclContextIsContainedInLookup(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by SymbolFileDWARF::DIEInDeclContext(), and SymbolFileDWARF::FindGlobalVariables().
|
inline |
Definition at line 55 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
Referenced by SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFilePDB::DeclContextMatchesThisSymbolFile(), SymbolFileDWARF::DIEInDeclContext(), FindDeclByName(), SymbolFilePDB::FindGlobalVariables(), SymbolFileDWARF::FindNamespace(), SymbolFilePDB::FindTypesByName(), lldb_private::ManualDWARFIndex::GetFunctions(), GetLanguage(), 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 91 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
|
private |
Definition at line 107 of file CompilerDeclContext.h.
Referenced by Clear(), FindDeclByName(), GetLanguage(), GetName(), GetOpaqueDeclContext(), GetScopeQualifiedName(), IsClassMethod(), IsContainedInLookup(), IsValid(), operator<(), and SetDeclContext().
|
private |
Definition at line 106 of file CompilerDeclContext.h.
Referenced by Clear(), FindDeclByName(), GetLanguage(), GetName(), GetScopeQualifiedName(), GetTypeSystem(), IsClassMethod(), IsContainedInLookup(), IsValid(), operator<(), and SetDeclContext().