LLDB mainline
|
"lldb/Expression/ClangASTSource.h" Container for all objects relevant to a single name lookup More...
#include <NameSearchContext.h>
Public Member Functions | |
NameSearchContext (TypeSystemClang &clang_ts, llvm::SmallVectorImpl< clang::NamedDecl * > &decls, clang::DeclarationName name, const clang::DeclContext *dc) | |
Constructor. | |
clang::NamedDecl * | AddVarDecl (const CompilerType &type) |
Create a VarDecl with the name being searched for and the provided type and register it in the right places. | |
clang::NamedDecl * | AddFunDecl (const CompilerType &type, bool extern_c=false) |
Create a FunDecl with the name being searched for and the provided type and register it in the right places. | |
clang::NamedDecl * | AddGenericFunDecl () |
Create a FunDecl with the name being searched for and generic type (i.e. | |
clang::NamedDecl * | AddTypeDecl (const CompilerType &compiler_type) |
Create a TypeDecl with the name being searched for and the provided type and register it in the right places. | |
void | AddLookupResult (clang::DeclContextLookupResult result) |
Add Decls from the provided DeclContextLookupResult to the list of results. | |
void | AddNamedDecl (clang::NamedDecl *decl) |
Add a NamedDecl to the list of results. | |
Public Attributes | |
TypeSystemClang & | m_clang_ts |
The type system of the AST from which the lookup originated. | |
llvm::SmallVectorImpl< clang::NamedDecl * > & | m_decls |
The list of declarations already constructed. | |
ClangASTImporter::NamespaceMapSP | m_namespace_map |
The mapping of all namespaces found for this request back to their modules. | |
const clang::DeclarationName | m_decl_name |
The name being looked for. | |
const clang::DeclContext * | m_decl_context |
The DeclContext to put declarations into. | |
llvm::SmallSet< CompilerType, 5 > | m_function_types |
All the types of functions that have been reported, so we don't report conflicts. | |
bool | m_found_variable = false |
bool | m_found_function_with_type_info = false |
bool | m_found_local_vars_nsp = false |
bool | m_found_type = false |
Private Member Functions | |
clang::ASTContext & | GetASTContext () const |
"lldb/Expression/ClangASTSource.h" Container for all objects relevant to a single name lookup
LLDB needs to create Decls for entities it finds. This class communicates what name is being searched for and provides helper functions to construct Decls given appropriate type information.
Definition at line 26 of file NameSearchContext.h.
|
inline |
Constructor.
Initializes class variables.
[in] | clang_ts | The TypeSystemClang from which the request originates. |
[in] | decls | A reference to a list into which new Decls will be placed. This list is typically empty when the function is called. |
[in] | name | The name being searched for (always an Identifier). |
[in] | dc | The DeclContext to register Decls in. |
Definition at line 63 of file NameSearchContext.h.
clang::NamedDecl * NameSearchContext::AddFunDecl | ( | const CompilerType & | type, |
bool | extern_c = false |
||
) |
Create a FunDecl with the name being searched for and the provided type and register it in the right places.
[in] | type | The opaque QualType for the FunDecl being registered. |
[in] | extern_c | If true, build an extern "C" linkage specification for this. |
Definition at line 38 of file NameSearchContext.cpp.
References lldb_private::TypeSystemClang::CheckOverloadedOperatorKindParameterCount(), lldb_private::CompilerType::TypeSystemSPWrapper::dyn_cast_or_null(), lldb_private::Expressions, lldb_private::GetLog(), lldb_private::ClangUtil::GetQualType(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::TypeSystemClang::IsOperator(), lldb_private::CompilerType::IsValid(), LLDB_LOG, m_decl_context, m_decl_name, m_decls, and m_function_types.
Referenced by AddGenericFunDecl(), and lldb_private::ClangExpressionDeclMap::AddOneFunction().
clang::NamedDecl * NameSearchContext::AddGenericFunDecl | ( | ) |
Create a FunDecl with the name being searched for and generic type (i.e.
intptr_t NAME_GOES_HERE(...)) and register it in the right places.
Definition at line 130 of file NameSearchContext.cpp.
References AddFunDecl(), GetASTContext(), lldb_private::TypeSystemClang::GetType(), and m_clang_ts.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction().
void NameSearchContext::AddLookupResult | ( | clang::DeclContextLookupResult | result | ) |
Add Decls from the provided DeclContextLookupResult to the list of results.
[in] | result | The DeclContextLookupResult, usually returned as the result of querying a DeclContext. |
Definition at line 173 of file NameSearchContext.cpp.
References m_decls.
void NameSearchContext::AddNamedDecl | ( | clang::NamedDecl * | decl | ) |
Add a NamedDecl to the list of results.
[in] | decl | The NamedDecl, usually returned as the result of querying a DeclContext. |
Definition at line 178 of file NameSearchContext.cpp.
References m_decls.
Referenced by lldb_private::ClangExpressionDeclMap::AddContextClassType(), lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::ClangASTSource::FindDeclInModules(), lldb_private::ClangASTSource::FindDeclInObjCRuntime(), lldb_private::ClangASTSource::FindObjCMethodDecls(), lldb_private::ClangASTSource::FindObjCMethodDeclsWithOrigin(), lldb_private::ClangASTSource::FindObjCPropertyAndIvarDeclsWithOrigin(), lldb_private::ClangExpressionDeclMap::LookupFunction(), lldb_private::ClangExpressionDeclMap::LookupInModulesDeclVendor(), lldb_private::ClangExpressionDeclMap::LookupLocalVarNamespace(), and lldb_private::ClangExpressionDeclMap::SearchPersistenDecls().
clang::NamedDecl * NameSearchContext::AddTypeDecl | ( | const CompilerType & | compiler_type | ) |
Create a TypeDecl with the name being searched for and the provided type and register it in the right places.
[in] | compiler_type | The opaque QualType for the TypeDecl being registered. |
Definition at line 144 of file NameSearchContext.cpp.
References lldb_private::ClangUtil::GetQualType(), lldb_private::ClangUtil::IsClangType(), and m_decls.
Referenced by lldb_private::ClangExpressionDeclMap::AddOneType(), and lldb_private::ClangASTSource::FindExternalVisibleDecls().
clang::NamedDecl * NameSearchContext::AddVarDecl | ( | const CompilerType & | type | ) |
Create a VarDecl with the name being searched for and the provided type and register it in the right places.
[in] | type | The opaque QualType for the VarDecl being registered. |
Definition at line 16 of file NameSearchContext.cpp.
References lldb_private::CompilerType::TypeSystemSPWrapper::dyn_cast_or_null(), lldb_private::ClangUtil::GetQualType(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::CompilerType::IsValid(), m_decl_context, m_decl_name, and m_decls.
Referenced by lldb_private::ClangExpressionDeclMap::AddExpressionVariable(), lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), lldb_private::ClangExpressionDeclMap::AddOneRegister(), and lldb_private::ClangExpressionDeclMap::AddOneVariable().
|
inlineprivate |
Definition at line 116 of file NameSearchContext.h.
References lldb_private::TypeSystemClang::getASTContext(), and m_clang_ts.
Referenced by AddGenericFunDecl().
TypeSystemClang& lldb_private::NameSearchContext::m_clang_ts |
The type system of the AST from which the lookup originated.
Definition at line 28 of file NameSearchContext.h.
Referenced by AddGenericFunDecl(), and GetASTContext().
const clang::DeclContext* lldb_private::NameSearchContext::m_decl_context |
The DeclContext to put declarations into.
Definition at line 37 of file NameSearchContext.h.
Referenced by AddFunDecl(), AddVarDecl(), lldb_private::ClangASTSource::FillNamespaceMap(), lldb_private::ClangASTSource::FindExternalVisibleDecls(), lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), lldb_private::ClangASTSource::FindObjCMethodDecls(), lldb_private::ClangASTSource::FindObjCPropertyAndIvarDecls(), and lldb_private::ClangASTSource::LookupInNamespace().
const clang::DeclarationName lldb_private::NameSearchContext::m_decl_name |
The name being looked for.
Definition at line 35 of file NameSearchContext.h.
Referenced by lldb_private::ClangExpressionDeclMap::AddContextClassType(), lldb_private::ClangExpressionDeclMap::AddExpressionVariable(), AddFunDecl(), lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), lldb_private::ClangExpressionDeclMap::AddOneRegister(), lldb_private::ClangExpressionDeclMap::AddOneVariable(), AddVarDecl(), lldb_private::ClangASTSource::FillNamespaceMap(), lldb_private::ClangASTSource::FindExternalVisibleDecls(), lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), lldb_private::ClangASTSource::FindObjCMethodDecls(), lldb_private::ClangASTSource::FindObjCMethodDeclsWithOrigin(), lldb_private::ClangASTSource::FindObjCPropertyAndIvarDecls(), and lldb_private::ClangASTSource::FindObjCPropertyAndIvarDeclsWithOrigin().
llvm::SmallVectorImpl<clang::NamedDecl *>& lldb_private::NameSearchContext::m_decls |
The list of declarations already constructed.
Definition at line 30 of file NameSearchContext.h.
Referenced by AddFunDecl(), AddLookupResult(), AddNamedDecl(), lldb_private::ClangASTSource::AddNamespace(), AddTypeDecl(), and AddVarDecl().
bool lldb_private::NameSearchContext::m_found_function_with_type_info = false |
Definition at line 43 of file NameSearchContext.h.
Referenced by lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), lldb_private::ClangExpressionDeclMap::LookupFunction(), and lldb_private::ClangExpressionDeclMap::LookupInModulesDeclVendor().
bool lldb_private::NameSearchContext::m_found_local_vars_nsp = false |
Definition at line 44 of file NameSearchContext.h.
Referenced by lldb_private::ClangExpressionDeclMap::LookupLocalVarNamespace().
bool lldb_private::NameSearchContext::m_found_type = false |
Definition at line 45 of file NameSearchContext.h.
Referenced by lldb_private::ClangASTSource::FindDeclInModules(), and lldb_private::ClangASTSource::FindExternalVisibleDecls().
bool lldb_private::NameSearchContext::m_found_variable = false |
Definition at line 42 of file NameSearchContext.h.
Referenced by lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), lldb_private::ClangExpressionDeclMap::LookupInModulesDeclVendor(), and lldb_private::ClangExpressionDeclMap::LookupLocalVariable().
llvm::SmallSet<CompilerType, 5> lldb_private::NameSearchContext::m_function_types |
All the types of functions that have been reported, so we don't report conflicts.
Definition at line 40 of file NameSearchContext.h.
Referenced by AddFunDecl().
ClangASTImporter::NamespaceMapSP lldb_private::NameSearchContext::m_namespace_map |
The mapping of all namespaces found for this request back to their modules.
Definition at line 33 of file NameSearchContext.h.
Referenced by lldb_private::ClangASTSource::FillNamespaceMap(), and lldb_private::ClangASTSource::FindExternalVisibleDecls().