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< lldb_private::CompilerContext > | GetCompilerContext () const |
Populate a valid compiler context from the current decl context. | |
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 31 of file CompilerDeclContext.h.
|
default |
Constructs an invalid CompilerDeclContext.
Referenced by IsContainedInLookup(), and operator<().
|
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 43 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
|
inline |
Definition at line 103 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 IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::ClangExpressionDeclMap::LookupLocalVariable().
std::vector< lldb_private::CompilerContext > CompilerDeclContext::GetCompilerContext | ( | ) | const |
Populate a valid compiler context from the current decl context.
Definition at line 63 of file CompilerDeclContext.cpp.
References IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::plugin::dwarf::DebugNamesDWARFIndex::GetNamespacesWithParents(), and lldb_private::TypeQuery::TypeQuery().
lldb::LanguageType CompilerDeclContext::GetLanguage | ( | ) |
Determines the original language of the decl context.
Definition at line 43 of file CompilerDeclContext.cpp.
References IsValid(), m_opaque_decl_ctx, and m_type_system.
ConstString CompilerDeclContext::GetName | ( | ) | const |
Definition at line 25 of file CompilerDeclContext.cpp.
References IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), and lldb_private::plugin::dwarf::SymbolFileDWARF::FindNamespace().
|
inline |
Definition at line 96 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(), lldb_private::npdb::SymbolFileNativePDB::FindNamespace(), lldb_private::plugin::dwarf::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 IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::ParseType().
|
inline |
Definition at line 94 of file CompilerDeclContext.h.
References m_type_system.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::TypeSystemClang::DeclContextGetMetaData(), lldb_private::TypeSystemClang::DeclContextGetTypeSystemClang(), lldb_private::plugin::dwarf::SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFilePDB::DeclContextMatchesThisSymbolFile(), lldb_private::plugin::dwarf::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==(), lldb_private::npdb::SymbolFileNativePDB::ParseDeclsForContext(), lldb_private::plugin::dwarf::SymbolFileDWARF::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 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 CompilerDeclContext(), IsValid(), m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::DIEInDeclContext(), and lldb_private::plugin::dwarf::SymbolFileDWARF::FindGlobalVariables().
|
inline |
Definition at line 55 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::DeclContextMatchesThisSymbolFile(), SymbolFilePDB::DeclContextMatchesThisSymbolFile(), lldb_private::plugin::dwarf::SymbolFileDWARF::DIEInDeclContext(), FindDeclByName(), lldb_private::npdb::SymbolFileNativePDB::FindFunctions(), lldb_private::npdb::SymbolFileNativePDB::FindGlobalVariables(), SymbolFilePDB::FindGlobalVariables(), lldb_private::plugin::dwarf::SymbolFileDWARF::FindNamespace(), GetCompilerContext(), lldb_private::plugin::dwarf::ManualDWARFIndex::GetFunctions(), GetLanguage(), GetName(), GetScopeQualifiedName(), IsClangDeclContext(), IsClassMethod(), IsContainedInLookup(), lldb_private::ClangExpressionDeclMap::LookupLocalVariable(), operator bool(), and lldb_private::plugin::dwarf::DWARFIndex::ProcessFunctionDIE().
|
inlineexplicit |
Definition at line 48 of file CompilerDeclContext.h.
References IsValid().
|
inline |
Definition at line 50 of file CompilerDeclContext.h.
References CompilerDeclContext(), m_opaque_decl_ctx, and m_type_system.
|
inline |
Definition at line 98 of file CompilerDeclContext.h.
References m_opaque_decl_ctx, and m_type_system.
|
private |
Definition at line 114 of file CompilerDeclContext.h.
Referenced by Clear(), CompilerDeclContext(), FindDeclByName(), GetCompilerContext(), GetLanguage(), GetName(), GetOpaqueDeclContext(), GetScopeQualifiedName(), IsClassMethod(), IsContainedInLookup(), IsValid(), operator<(), and SetDeclContext().
|
private |
Definition at line 113 of file CompilerDeclContext.h.
Referenced by Clear(), CompilerDeclContext(), FindDeclByName(), GetCompilerContext(), GetLanguage(), GetName(), GetScopeQualifiedName(), GetTypeSystem(), IsClassMethod(), IsContainedInLookup(), IsValid(), operator<(), and SetDeclContext().