LLDB  mainline
Public Member Functions | Public Attributes | Private Member Functions | List of all members
lldb_private::NameSearchContext Class Reference

"lldb/Expression/ClangASTSource.h" Container for all objects relevant to a single name lookup More...

#include <NameSearchContext.h>

Collaboration diagram for lldb_private::NameSearchContext:
Collaboration graph
[legend]

Public Member Functions

 NameSearchContext (TypeSystemClang &clang_ts, llvm::SmallVectorImpl< clang::NamedDecl *> &decls, clang::DeclarationName name, const clang::DeclContext *dc)
 Constructor. More...
 
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. More...
 
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. More...
 
clang::NamedDecl * AddGenericFunDecl ()
 Create a FunDecl with the name being searched for and generic type (i.e. More...
 
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. More...
 
void AddLookupResult (clang::DeclContextLookupResult result)
 Add Decls from the provided DeclContextLookupResult to the list of results. More...
 
void AddNamedDecl (clang::NamedDecl *decl)
 Add a NamedDecl to the list of results. More...
 

Public Attributes

TypeSystemClangm_clang_ts
 The type system of the AST from which the lookup originated. More...
 
llvm::SmallVectorImpl< clang::NamedDecl * > & m_decls
 The list of declarations already constructed. More...
 
ClangASTImporter::NamespaceMapSP m_namespace_map
 The mapping of all namespaces found for this request back to their modules. More...
 
const clang::DeclarationName m_decl_name
 The name being looked for. More...
 
const clang::DeclContext * m_decl_context
 The DeclContext to put declarations into. More...
 
llvm::SmallSet< CompilerType, 5 > m_function_types
 All the types of functions that have been reported, so we don't report conflicts. More...
 
bool m_found_variable = false
 
bool m_found_function_with_type_info = false
 
bool m_found_function = false
 
bool m_found_local_vars_nsp = false
 
bool m_found_type = false
 

Private Member Functions

clang::ASTContext & GetASTContext () const
 

Detailed Description

"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.

Constructor & Destructor Documentation

◆ NameSearchContext()

lldb_private::NameSearchContext::NameSearchContext ( TypeSystemClang clang_ts,
llvm::SmallVectorImpl< clang::NamedDecl *> &  decls,
clang::DeclarationName  name,
const clang::DeclContext *  dc 
)
inline

Constructor.

Initializes class variables.

Parameters
[in]clang_tsThe TypeSystemClang from which the request originates.
[in]declsA reference to a list into which new Decls will be placed. This list is typically empty when the function is called.
[in]nameThe name being searched for (always an Identifier).
[in]dcThe DeclContext to register Decls in.

Definition at line 64 of file NameSearchContext.h.

References AddFunDecl(), AddGenericFunDecl(), AddLookupResult(), AddNamedDecl(), AddTypeDecl(), and AddVarDecl().

Member Function Documentation

◆ AddFunDecl()

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.

Parameters
[in]typeThe opaque QualType for the FunDecl being registered.
[in]extern_cIf true, build an extern "C" linkage specification for this.

Definition at line 38 of file NameSearchContext.cpp.

References lldb_private::TypeSystemClang::getASTContext(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::CompilerType::IsValid(), LIBLLDB_LOG_EXPRESSIONS, and LLDB_LOG.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), and NameSearchContext().

◆ AddGenericFunDecl()

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 129 of file NameSearchContext.cpp.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), and NameSearchContext().

◆ AddLookupResult()

void NameSearchContext::AddLookupResult ( clang::DeclContextLookupResult  result)

Add Decls from the provided DeclContextLookupResult to the list of results.

Parameters
[in]resultThe DeclContextLookupResult, usually returned as the result of querying a DeclContext.

Definition at line 172 of file NameSearchContext.cpp.

Referenced by NameSearchContext().

◆ AddNamedDecl()

void NameSearchContext::AddNamedDecl ( clang::NamedDecl *  decl)

◆ AddTypeDecl()

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.

Parameters
[in]compiler_typeThe opaque QualType for the TypeDecl being registered.

Definition at line 143 of file NameSearchContext.cpp.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneType(), lldb_private::ClangASTSource::FindExternalVisibleDecls(), and NameSearchContext().

◆ AddVarDecl()

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.

Parameters
[in]typeThe opaque QualType for the VarDecl being registered.

Definition at line 15 of file NameSearchContext.cpp.

References lldb_private::TypeSystemClang::getASTContext(), lldb_private::CompilerType::GetTypeSystem(), and lldb_private::CompilerType::IsValid().

Referenced by lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), lldb_private::ClangExpressionDeclMap::AddOneRegister(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), and NameSearchContext().

◆ GetASTContext()

clang::ASTContext& lldb_private::NameSearchContext::GetASTContext ( ) const
inlineprivate

Member Data Documentation

◆ m_clang_ts

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.

◆ m_decl_context

const clang::DeclContext* lldb_private::NameSearchContext::m_decl_context

◆ m_decl_name

const clang::DeclarationName lldb_private::NameSearchContext::m_decl_name

◆ m_decls

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 lldb_private::ClangASTSource::AddNamespace().

◆ m_found_function

bool lldb_private::NameSearchContext::m_found_function = false

◆ m_found_function_with_type_info

bool lldb_private::NameSearchContext::m_found_function_with_type_info = false

◆ m_found_local_vars_nsp

bool lldb_private::NameSearchContext::m_found_local_vars_nsp = false

◆ m_found_type

bool lldb_private::NameSearchContext::m_found_type = false

◆ m_found_variable

bool lldb_private::NameSearchContext::m_found_variable = false

◆ m_function_types

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.

◆ m_namespace_map

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().


The documentation for this class was generated from the following files: