clang 20.0.0git
Public Member Functions | List of all members
clang::ExternalSource Class Reference
Inheritance diagram for clang::ExternalSource:
Inheritance graph
[legend]

Public Member Functions

 ExternalSource (ASTContext &ChildASTCtxt, FileManager &ChildFM, ASTContext &ParentASTCtxt, FileManager &ParentFM)
 
bool FindExternalVisibleDeclsByName (const DeclContext *DC, DeclarationName Name) override
 Find all declarations with the given name in the given context, and add them to the context by calling SetExternalVisibleDeclsForName or SetNoExternalVisibleDeclsForName.
 
void completeVisibleDeclsMap (const clang::DeclContext *childDeclContext) override
 Ensures that the table of all visible declarations inside this context is up to date.
 
- Public Member Functions inherited from clang::ExternalASTSource
 ExternalASTSource ()=default
 
virtual ~ExternalASTSource ()
 
uint32_t getGeneration () const
 Get the current generation of this AST source.
 
virtual DeclGetExternalDecl (GlobalDeclID ID)
 Resolve a declaration ID into a declaration, potentially building a new declaration.
 
virtual Selector GetExternalSelector (uint32_t ID)
 Resolve a selector ID into a selector.
 
virtual uint32_t GetNumExternalSelectors ()
 Returns the number of selectors known to the external AST source.
 
virtual StmtGetExternalDeclStmt (uint64_t Offset)
 Resolve the offset of a statement in the decl stream into a statement.
 
virtual CXXCtorInitializer ** GetExternalCXXCtorInitializers (uint64_t Offset)
 Resolve the offset of a set of C++ constructor initializers in the decl stream into an array of initializers.
 
virtual CXXBaseSpecifierGetExternalCXXBaseSpecifiers (uint64_t Offset)
 Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.
 
virtual void updateOutOfDateIdentifier (const IdentifierInfo &II)
 Update an out-of-date identifier.
 
virtual bool FindExternalVisibleDeclsByName (const DeclContext *DC, DeclarationName Name)
 Find all declarations with the given name in the given context, and add them to the context by calling SetExternalVisibleDeclsForName or SetNoExternalVisibleDeclsForName.
 
virtual void completeVisibleDeclsMap (const DeclContext *DC)
 Ensures that the table of all visible declarations inside this context is up to date.
 
virtual ModulegetModule (unsigned ID)
 Retrieve the module that corresponds to the given module ID.
 
virtual std::optional< ASTSourceDescriptorgetSourceDescriptor (unsigned ID)
 Return a descriptor for the corresponding module, if one exists.
 
virtual ExtKind hasExternalDefinitions (const Decl *D)
 
virtual void FindExternalLexicalDecls (const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result)
 Finds all declarations lexically contained within the given DeclContext, after applying an optional filter predicate.
 
void FindExternalLexicalDecls (const DeclContext *DC, SmallVectorImpl< Decl * > &Result)
 Finds all declarations lexically contained within the given DeclContext.
 
virtual void FindFileRegionDecls (FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls)
 Get the decls that are contained in a file in the Offset/Length range.
 
virtual void CompleteRedeclChain (const Decl *D)
 Gives the external AST source an opportunity to complete the redeclaration chain for a declaration.
 
virtual void CompleteType (TagDecl *Tag)
 Gives the external AST source an opportunity to complete an incomplete type.
 
virtual void CompleteType (ObjCInterfaceDecl *Class)
 Gives the external AST source an opportunity to complete an incomplete Objective-C class.
 
virtual void ReadComments ()
 Loads comment ranges.
 
virtual void StartedDeserializing ()
 Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeserializing is called there may be decls that are initializing.
 
virtual void FinishedDeserializing ()
 Notify ExternalASTSource that we finished the deserialization of a decl or type.
 
virtual void StartTranslationUnit (ASTConsumer *Consumer)
 Function that will be invoked when we begin parsing a new translation unit involving this external AST source.
 
virtual void PrintStats ()
 Print any statistics that have been gathered regarding the external AST source.
 
virtual bool layoutRecordType (const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap< const FieldDecl *, uint64_t > &FieldOffsets, llvm::DenseMap< const CXXRecordDecl *, CharUnits > &BaseOffsets, llvm::DenseMap< const CXXRecordDecl *, CharUnits > &VirtualBaseOffsets)
 Perform layout on the given record.
 
MemoryBufferSizes getMemoryBufferSizes () const
 Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memory.
 
virtual void getMemoryBufferSizes (MemoryBufferSizes &sizes) const
 
virtual bool isA (const void *ClassID) const
 LLVM-style RTTI.
 

Additional Inherited Members

- Public Types inherited from clang::ExternalASTSource
enum  ExtKind { EK_Always , EK_Never , EK_ReplyHazy }
 
- Static Public Member Functions inherited from clang::ExternalASTSource
static bool classof (const ExternalASTSource *S)
 
- Protected Member Functions inherited from clang::ExternalASTSource
uint32_t incrementGeneration (ASTContext &C)
 Increment the current generation.
 
- Static Protected Member Functions inherited from clang::ExternalASTSource
static DeclContextLookupResult SetExternalVisibleDeclsForName (const DeclContext *DC, DeclarationName Name, ArrayRef< NamedDecl * > Decls)
 
static DeclContextLookupResult SetNoExternalVisibleDeclsForName (const DeclContext *DC, DeclarationName Name)
 

Detailed Description

Definition at line 220 of file CodeCompletion.cpp.

Constructor & Destructor Documentation

◆ ExternalSource()

clang::ExternalSource::ExternalSource ( ASTContext ChildASTCtxt,
FileManager ChildFM,
ASTContext ParentASTCtxt,
FileManager ParentFM 
)

Definition at line 262 of file CodeCompletion.cpp.

Member Function Documentation

◆ completeVisibleDeclsMap()

void clang::ExternalSource::completeVisibleDeclsMap ( const clang::DeclContext DC)
overridevirtual

Ensures that the table of all visible declarations inside this context is up to date.

The default implementation of this function is a no-op.

Reimplemented from clang::ExternalASTSource.

Definition at line 290 of file CodeCompletion.cpp.

References clang::NamedDecl::getDeclName(), clang::Decl::getPreviousDecl(), clang::DeclContext::hasExternalVisibleStorage(), clang::ExternalASTSource::SetExternalVisibleDeclsForName(), and clang::DeclContext::setHasExternalLexicalStorage().

◆ FindExternalVisibleDeclsByName()

bool clang::ExternalSource::FindExternalVisibleDeclsByName ( const DeclContext DC,
DeclarationName  Name 
)
overridevirtual

Find all declarations with the given name in the given context, and add them to the context by calling SetExternalVisibleDeclsForName or SetNoExternalVisibleDeclsForName.

Returns
true if any declarations might have been found, false if we definitely have no declarations with tbis name.

The default implementation of this method is a no-op returning false.

Reimplemented from clang::ExternalASTSource.

Definition at line 273 of file CodeCompletion.cpp.

References clang::DeclContextLookupResult::empty(), clang::IdentifierTable::get(), clang::ASTContext::Idents, and clang::DeclContext::lookup().


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