17 using namespace clang;
26 Sources.push_back(&s1);
27 Sources.push_back(&s2);
38 Sources.push_back(&source);
46 for(
size_t i = 0; i < Sources.size(); ++i)
53 for (
size_t i = 0; i < Sources.size(); ++i)
59 for(
size_t i = 0; i < Sources.size(); ++i) {
60 Sel = Sources[i]->GetExternalSelector(ID);
69 for(
size_t i = 0; i < Sources.size(); ++i)
75 for(
size_t i = 0; i < Sources.size(); ++i)
83 for(
size_t i = 0; i < Sources.size(); ++i)
91 for (
auto *
S : Sources)
92 if (
auto *R =
S->GetExternalCXXCtorInitializers(Offset))
99 bool AnyDeclsFound =
false;
100 for (
size_t i = 0; i < Sources.size(); ++i)
102 return AnyDeclsFound;
106 for(
size_t i = 0; i < Sources.size(); ++i)
114 for(
size_t i = 0; i < Sources.size(); ++i)
125 for(
size_t i = 0; i < Sources.size(); ++i)
130 for(
size_t i = 0; i < Sources.size(); ++i)
135 for(
size_t i = 0; i < Sources.size(); ++i)
140 for(
size_t i = 0; i < Sources.size(); ++i)
145 for(
size_t i = 0; i < Sources.size(); ++i)
150 for(
size_t i = 0; i < Sources.size(); ++i)
155 for(
size_t i = 0; i < Sources.size(); ++i)
160 for(
size_t i = 0; i < Sources.size(); ++i)
167 llvm::DenseMap<const FieldDecl *, uint64_t> &FieldOffsets,
168 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets,
169 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &VirtualBaseOffsets){
170 for(
size_t i = 0; i < Sources.size(); ++i)
172 BaseOffsets, VirtualBaseOffsets))
179 for(
size_t i = 0; i < Sources.size(); ++i)
190 for(
size_t i = 0; i < Sources.size(); ++i)
195 for(
size_t i = 0; i < Sources.size(); ++i)
200 for(
size_t i = 0; i < Sources.size(); ++i)
206 for(
size_t i = 0; i < Sources.size(); ++i)
211 llvm::DenseMap<NamedDecl*, SourceLocation> &Undefined){
212 for(
size_t i = 0; i < Sources.size(); ++i)
220 for (
auto &Source : Sources)
221 Source->ReadMismatchingDeleteExpressions(Exprs);
225 for(
size_t i = 0; i < Sources.size(); ++i)
233 for(
size_t i = 0; i < Sources.size(); ++i)
239 for(
size_t i = 0; i < Sources.size(); ++i)
245 for(
size_t i = 0; i < Sources.size(); ++i)
251 for(
size_t i = 0; i < Sources.size(); ++i)
257 for(
size_t i = 0; i < Sources.size(); ++i)
263 for(
size_t i = 0; i < Sources.size(); ++i)
269 for(
size_t i = 0; i < Sources.size(); ++i)
275 for(
size_t i = 0; i < Sources.size(); ++i)
282 for(
size_t i = 0; i < Sources.size(); ++i)
287 llvm::MapVector<const FunctionDecl *, LateParsedTemplate *> &LPTMap) {
288 for (
size_t i = 0; i < Sources.size(); ++i)
297 bool EnteringContext,
299 for (
size_t I = 0, E = Sources.size(); I < E; ++I) {
302 EnteringContext, OPT))
310 for (
size_t I = 0, E = Sources.size(); I < E; ++I) {
Smart pointer class that efficiently represents Objective-C method names.
Simple class containing the result of Sema::CorrectTypo.
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...
void completeVisibleDeclsMap(const DeclContext *DC) override
Ensures that the table of all visible declarations inside this context is up to date.
void StartTranslationUnit(ASTConsumer *Consumer) override
Function that will be invoked when we begin parsing a new translation unit involving this external AS...
void StartedDeserializing() override
Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeseriali...
void ReadMethodPool(Selector Sel) override
Load the contents of the global method pool for a given selector.
void CompleteRedeclChain(const Decl *D) override
Complete the redeclaration chain if it's been extended since the previous generation of the AST sourc...
bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name) override
Find all declarations with the given name in the given context.
MemoryBufferSizes getMemoryBufferSizes() const
~MultiplexExternalSemaSource() override
bool LookupUnqualified(LookupResult &R, Scope *S) override
Do last resort, unqualified lookup on a LookupResult that Sema cannot find.
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
void InitializeSema(Sema &S) override
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the ...
bool isNull() const
Determine whether this is the empty selector.
void ReadWeakUndeclaredIdentifiers(SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) override
Read the set of weak, undeclared identifiers known to the external Sema source.
Represents the results of name lookup.
Stmt * GetExternalDeclStmt(uint64_t Offset) override
Resolve the offset of a statement in the decl stream into a statement.
void ReadTentativeDefinitions(SmallVectorImpl< VarDecl * > &Defs) override
Read the set of tentative definitions known to the external Sema source.
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.
uint32_t GetNumExternalSelectors() override
Returns the number of selectors known to the external AST source.
Represents a C++ nested-name-specifier or a global scope specifier.
Decl * GetExternalDecl(uint32_t ID) override
Resolve a declaration ID into a declaration, potentially building a new declaration.
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...
Represents an ObjC class declaration.
Sema - This implements semantic analysis and AST building for C.
void ForgetSema() override
Inform the semantic consumer that Sema is no longer available.
ID
Defines the set of possible language-specific address spaces.
ExternalLoadResult
Enumeration describing the result of loading information from an external 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. Length can be 0 to indicate a ...
void FinishedDeserializing() override
Notify ExternalASTSource that we finished the deserialization of a decl or type. Must be paired with ...
void CompleteType(TagDecl *Tag) override
Gives the external AST source an opportunity to complete an incomplete type.
Loading the external information has succeeded.
void PrintStats() override
Print any statistics that have been gathered regarding the external AST source.
void ReadUsedVTables(SmallVectorImpl< ExternalVTableUse > &VTables) override
Read the set of used vtables known to the external Sema source.
CXXCtorInitializer ** GetExternalCXXCtorInitializers(uint64_t Offset) override
Resolve a handle to a list of ctor initializers into the list of initializers themselves.
The result type of a method or function.
void ReadPendingInstantiations(SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) override
Read the set of pending instantiations known to the external Sema source.
void ReadMismatchingDeleteExpressions(llvm::MapVector< FieldDecl *, llvm::SmallVector< std::pair< SourceLocation, bool >, 4 >> &Exprs) override
An abstract interface that should be implemented by external AST sources that also provide informatio...
void ReadUnusedLocalTypedefNameCandidates(llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override
Read the set of potentially unused typedefs known to the source.
ExternalLoadResult FindExternalLexicalDecls(const DeclContext *DC, bool(*isKindWeWant)(Decl::Kind), SmallVectorImpl< Decl * > &Result) override
Finds all declarations lexically contained within the given DeclContext, after applying an optional f...
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
TagDecl - Represents the declaration of a struct/union/class/enum.
void ReadReferencedSelectors(SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) override
Read the set of referenced selectors known to the external Sema source.
void ReadDelegatingConstructors(SmallVectorImpl< CXXConstructorDecl * > &Decls) override
Read the set of delegating constructors known to the external Sema source.
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...
MultiplexExternalSemaSource(ExternalSemaSource &s1, ExternalSemaSource &s2)
Constructs a new multiplexing external sema source and appends the given element to it...
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
bool empty() const
Return true if no decls were found.
void ReadUndefinedButUsed(llvm::DenseMap< NamedDecl *, SourceLocation > &Undefined) override
Load the set of used but not defined functions or variables with internal linkage, or used but not defined inline functions.
Represents a C++ base or member initializer.
void addSource(ExternalSemaSource &source)
Appends new source to the source list.
Represents a base class of a C++ class.
void ReadComments() override
Loads comment ranges.
Selector GetExternalSelector(uint32_t ID) override
Resolve a selector ID into a selector.
Kind
Lists the kind of concrete classes of Decl.
void ReadExtVectorDecls(SmallVectorImpl< TypedefNameDecl * > &Decls) override
Read the set of ext_vector type declarations known to the external Sema source.
bool MaybeDiagnoseMissingCompleteType(SourceLocation Loc, QualType T) override
Produces a diagnostic note if one of the attached sources contains a complete definition for T...
void ReadUnusedFileScopedDecls(SmallVectorImpl< const DeclaratorDecl * > &Decls) override
Read the set of unused file-scope declarations known to the external Sema source. ...
void ReadLateParsedTemplates(llvm::MapVector< const FunctionDecl *, LateParsedTemplate * > &LPTMap) override
Read the set of late parsed template functions for this source.