Go to the documentation of this file.
12 #ifndef LLVM_CLANG_SEMA_MULTIPLEXEXTERNALSEMASOURCE_H
13 #define LLVM_CLANG_SEMA_MULTIPLEXEXTERNALSEMASOURCE_H
17 #include "llvm/ADT/SmallVector.h"
22 class CXXConstructorDecl;
25 struct ExternalVTableUse;
30 class TypedefNameDecl;
112 llvm::function_ref<
bool(
Decl::Kind)> IsKindWeWant,
186 llvm::DenseMap<const FieldDecl *, uint64_t> &FieldOffsets,
187 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets,
189 CharUnits> &VirtualBaseOffsets)
override;
223 llvm::MapVector<NamedDecl *, SourceLocation> &Undefined)
override;
321 SmallVectorImpl<std::pair<ValueDecl*, SourceLocation> >& Pending)
override;
330 llvm::MapVector<
const FunctionDecl *, std::unique_ptr<LateParsedTemplate>>
348 bool EnteringContext,
366 bool isA(
const void *ClassID)
const override {
Represents an ObjC class declaration.
void FinishedDeserializing() override
Notify ExternalASTSource that we finished the deserialization of a decl or type.
CXXCtorInitializer ** GetExternalCXXCtorInitializers(uint64_t Offset) override
Resolve a handle to a list of ctor initializers into the list of initializers themselves.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Simple class containing the result of Sema::CorrectTypo.
void ReadTentativeDefinitions(SmallVectorImpl< VarDecl * > &Defs) override
Read the set of tentative definitions known to the external Sema source.
Encodes a location in the source.
void ReadMismatchingDeleteExpressions(llvm::MapVector< FieldDecl *, llvm::SmallVector< std::pair< SourceLocation, bool >, 4 >> &Exprs) override
A (possibly-)qualified type.
void ForgetSema() override
Inform the semantic consumer that Sema is no longer available.
Represents a member of a struct/union/class.
void ReadKnownNamespaces(SmallVectorImpl< NamespaceDecl * > &Namespaces) override
Load the set of namespaces that are known to the external source, which will be used during typo corr...
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) override
Perform layout on the given record.
Represents the results of name lookup.
void ReadUnusedFileScopedDecls(SmallVectorImpl< const DeclaratorDecl * > &Decls) override
Read the set of unused file-scope declarations known to the external Sema source.
bool isA(const void *ClassID) const override
LLVM-style RTTI.
void completeVisibleDeclsMap(const DeclContext *DC) override
Ensures that the table of all visible declarations inside this context is up to date.
Represents a C++ nested-name-specifier or a global scope specifier.
Module * getModule(unsigned ID) override
Retrieve the module that corresponds to the given module ID.
The name of a declaration.
void CompleteType(TagDecl *Tag) override
Gives the external AST source an opportunity to complete an incomplete type.
Kind
Lists the kind of concrete classes of Decl.
void ReadComments() override
Loads comment ranges.
void StartTranslationUnit(ASTConsumer *Consumer) override
Function that will be invoked when we begin parsing a new translation unit involving this external AS...
void CompleteRedeclChain(const Decl *D) override
Complete the redeclaration chain if it's been extended since the previous generation of the AST sourc...
Selector GetExternalSelector(uint32_t ID) override
Resolve a selector ID into a selector.
Describes a module or submodule.
bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) override
Find all declarations with the given name in the given context.
void addSource(ExternalSemaSource &source)
Appends new source to the source list.
Scope - A scope is a transient data structure that is used while parsing the program.
void ReadLateParsedTemplates(llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate >> &LPTMap) override
Read the set of late parsed template functions for this source.
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.
An abstract interface that should be implemented by external AST sources that also provide informatio...
An abstract interface that should be implemented by external AST sources that also provide informatio...
void InitializeSema(Sema &S) override
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the ...
Stmt * GetExternalDeclStmt(uint64_t Offset) override
Resolve the offset of a statement in the decl stream into a statement.
bool MaybeDiagnoseMissingCompleteType(SourceLocation Loc, QualType T) override
Produces a diagnostic note if one of the attached sources contains a complete definition for T.
Represents the declaration of a struct/union/class/enum.
void ReadDeclsToCheckForDeferredDiags(llvm::SmallSetVector< Decl *, 4 > &Decls) override
Read the set of decls to be checked for deferred diags.
void ReadDelegatingConstructors(SmallVectorImpl< CXXConstructorDecl * > &Decls) override
Read the set of delegating constructors known to the external Sema source.
ExtKind hasExternalDefinitions(const Decl *D) override
void ReadMethodPool(Selector Sel) override
Load the contents of the global method pool for a given selector.
TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, int LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, DeclContext *MemberContext, bool EnteringContext, const ObjCObjectPointerType *OPT) override
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to...
MemoryBufferSizes getMemoryBufferSizes() const
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memor...
Represents a pointer to an Objective C object.
Represents a C++ struct/union/class.
void StartedDeserializing() override
Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeseriali...
void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result) override
Finds all declarations lexically contained within the given DeclContext, after applying an optional f...
Decl - This represents one declaration (or definition), e.g.
bool LookupUnqualified(LookupResult &R, Scope *S) override
Do last resort, unqualified lookup on a LookupResult that Sema cannot find.
void ReadUsedVTables(SmallVectorImpl< ExternalVTableUse > &VTables) override
Read the set of used vtables known to the external Sema source.
Sema - This implements semantic analysis and AST building for C.
static bool classof(const ExternalASTSource *S)
void ReadUnusedLocalTypedefNameCandidates(llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override
Read the set of potentially unused typedefs known to the source.
void FindFileRegionDecls(FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls) override
Get the decls that are contained in a file in the Offset/Length range.
void ReadReferencedSelectors(SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) override
Read the set of referenced selectors known to the external Sema source.
Smart pointer class that efficiently represents Objective-C method names.
~MultiplexExternalSemaSource() override
Stmt - This represents one statement.
CXXBaseSpecifier * GetExternalCXXBaseSpecifiers(uint64_t Offset) override
Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.
void ReadWeakUndeclaredIdentifiers(SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) override
Read the set of weak, undeclared identifiers known to the external Sema source.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a base class of a C++ class.
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
void ReadExtVectorDecls(SmallVectorImpl< TypedefNameDecl * > &Decls) override
Read the set of ext_vector type declarations known to the external Sema source.
Decl * GetExternalDecl(uint32_t ID) override
Resolve a declaration ID into a declaration, potentially building a new declaration.
MultiplexExternalSemaSource(ExternalSemaSource &s1, ExternalSemaSource &s2)
Constructs a new multiplexing external sema source and appends the given element to it.
CharUnits - This is an opaque type for sizes expressed in character units.
bool isA(const void *ClassID) const override
LLVM-style RTTI.
Represents a C++ base or member initializer.
Abstract interface for external sources of AST nodes.
void updateOutOfDateSelector(Selector Sel) override
Load the contents of the global method pool for a given selector if necessary.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Represents a function declaration or definition.
Represents a struct/union/class.
uint32_t GetNumExternalSelectors() override
Returns the number of selectors known to the external AST source.
void PrintStats() override
Print any statistics that have been gathered regarding the external AST source.
void ReadPendingInstantiations(SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) override
Read the set of pending instantiations known to the external Sema source.
void ReadUndefinedButUsed(llvm::MapVector< NamedDecl *, SourceLocation > &Undefined) override
Load the set of used but not defined functions or variables with internal linkage,...