clang: lib/Sema/MultiplexExternalSemaSource.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
14
15using namespace clang;
16
17char MultiplexExternalSemaSource::ID;
18
19
20
21
25 Sources.push_back(std::move(S1));
26 Sources.push_back(std::move(S2));
27}
28
29
30
31
32
35 Sources.push_back(std::move(Source));
36}
37
38
39
40
41
43 for(size_t i = 0; i < Sources.size(); ++i)
46 return nullptr;
47}
48
50 for (size_t i = 0; i < Sources.size(); ++i)
52}
53
56 for(size_t i = 0; i < Sources.size(); ++i) {
57 Sel = Sources[i]->GetExternalSelector(ID);
59 return Sel;
60 }
61 return Sel;
62}
63
65 uint32_t total = 0;
66 for(size_t i = 0; i < Sources.size(); ++i)
68 return total;
69}
70
72 for(size_t i = 0; i < Sources.size(); ++i)
75 return nullptr;
76}
77
79 uint64_t Offset){
80 for(size_t i = 0; i < Sources.size(); ++i)
82 return R;
83 return nullptr;
84}
85
88 for (auto &S : Sources)
89 if (auto *R = S->GetExternalCXXCtorInitializers(Offset))
90 return R;
91 return nullptr;
92}
93
96 for (const auto &S : Sources)
97 if (auto EK = S->hasExternalDefinitions(D))
99 return EK;
101}
102
105 for (const auto &S : Sources)
106 if (S->wasThisDeclarationADefinition(FD))
107 return true;
108 return false;
109}
110
114 bool AnyDeclsFound = false;
115 for (size_t i = 0; i < Sources.size(); ++i)
116 AnyDeclsFound |=
118 return AnyDeclsFound;
119}
120
122 const Decl *D, bool OnlyPartial) {
123 bool Loaded = false;
124 for (size_t i = 0; i < Sources.size(); ++i)
126 return Loaded;
127}
128
131 bool AnyNewSpecsLoaded = false;
132 for (size_t i = 0; i < Sources.size(); ++i)
133 AnyNewSpecsLoaded |=
135 return AnyNewSpecsLoaded;
136}
137
139 for(size_t i = 0; i < Sources.size(); ++i)
141}
142
146 for(size_t i = 0; i < Sources.size(); ++i)
148}
149
151 unsigned Offset,
152 unsigned Length,
154 for(size_t i = 0; i < Sources.size(); ++i)
156}
157
159 for(size_t i = 0; i < Sources.size(); ++i)
161}
162
164 for(size_t i = 0; i < Sources.size(); ++i)
166}
167
169 for(size_t i = 0; i < Sources.size(); ++i)
171}
172
174 for(size_t i = 0; i < Sources.size(); ++i)
176}
177
179 for(size_t i = 0; i < Sources.size(); ++i)
181}
182
184 for(size_t i = 0; i < Sources.size(); ++i)
186}
187
189 for(size_t i = 0; i < Sources.size(); ++i)
191}
192
194 for (size_t i = 0; i < Sources.size(); ++i)
195 if (auto M = Sources[i]->getModule(ID))
196 return M;
197 return nullptr;
198}
199
201 uint64_t &Size,
202 uint64_t &Alignment,
203 llvm::DenseMap<const FieldDecl *, uint64_t> &FieldOffsets,
204 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets,
205 llvm::DenseMap<const CXXRecordDecl *, CharUnits> &VirtualBaseOffsets){
206 for(size_t i = 0; i < Sources.size(); ++i)
208 BaseOffsets, VirtualBaseOffsets))
209 return true;
210 return false;
211}
212
215 for(size_t i = 0; i < Sources.size(); ++i)
217
218}
219
220
221
222
223
224
226 for(size_t i = 0; i < Sources.size(); ++i)
228}
229
231 for(size_t i = 0; i < Sources.size(); ++i)
233}
234
236 for(size_t i = 0; i < Sources.size(); ++i)
238}
239
241 for(size_t i = 0; i < Sources.size(); ++i)
243}
244
247 for(size_t i = 0; i < Sources.size(); ++i)
249}
250
252 llvm::MapVector<NamedDecl *, SourceLocation> &Undefined) {
253 for(size_t i = 0; i < Sources.size(); ++i)
255}
256
260 Exprs) {
261 for (auto &Source : Sources)
262 Source->ReadMismatchingDeleteExpressions(Exprs);
263}
264
266 for(size_t i = 0; i < Sources.size(); ++i)
268
269 return !R.empty();
270}
271
274 for(size_t i = 0; i < Sources.size(); ++i)
276}
277
280 for(size_t i = 0; i < Sources.size(); ++i)
282}
283
286 for(size_t i = 0; i < Sources.size(); ++i)
288}
289
292 for(size_t i = 0; i < Sources.size(); ++i)
294}
295
298 for(size_t i = 0; i < Sources.size(); ++i)
300}
301
304 for(size_t i = 0; i < Sources.size(); ++i)
306}
307
309 SmallVectorImpl<std::pair<Selector, SourceLocation> > &Sels) {
310 for(size_t i = 0; i < Sources.size(); ++i)
312}
313
315 SmallVectorImpl<std::pair<IdentifierInfo*, WeakInfo> > &WI) {
316 for(size_t i = 0; i < Sources.size(); ++i)
318}
319
322 for(size_t i = 0; i < Sources.size(); ++i)
324}
325
329 for(size_t i = 0; i < Sources.size(); ++i)
331}
332
334 llvm::MapVector<const FunctionDecl *, std::unique_ptr>
335 &LPTMap) {
336 for (size_t i = 0; i < Sources.size(); ++i)
338}
339
345 bool EnteringContext,
347 for (size_t I = 0, E = Sources.size(); I < E; ++I) {
349 MemberContext,
350 EnteringContext, OPT))
351 return C;
352 }
354}
355
358 for (size_t I = 0, E = Sources.size(); I < E; ++I) {
360 return true;
361 }
362 return false;
363}
364
367 for (auto &Source : Sources)
368 Source->AssignedLambdaNumbering(Lambda);
369}
llvm::MachO::Record Record
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.
Represents a base class of a C++ class.
Represents a C++ base or member initializer.
Represents a C++ struct/union/class.
Represents a C++ nested-name-specifier or a global scope specifier.
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
Kind
Lists the kind of concrete classes of Decl.
The name of a declaration.
MemoryBufferSizes getMemoryBufferSizes() const
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memor...
Represents a member of a struct/union/class.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a function declaration or definition.
Represents the results of name lookup.
bool empty() const
Return true if no decls were found.
Describes a module or submodule.
void ReadLateParsedTemplates(llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > &LPTMap) override
Read the set of late parsed template functions for this source.
Definition MultiplexExternalSemaSource.cpp:333
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.
Definition MultiplexExternalSemaSource.cpp:150
bool LoadExternalSpecializations(const Decl *D, bool OnlyPartial) override
Load all the external specializations for the Decl.
Definition MultiplexExternalSemaSource.cpp:121
void updateOutOfDateSelector(Selector Sel) override
Load the contents of the global method pool for a given selector if necessary.
Definition MultiplexExternalSemaSource.cpp:240
Stmt * GetExternalDeclStmt(uint64_t Offset) override
Resolve the offset of a statement in the decl stream into a statement.
Definition MultiplexExternalSemaSource.cpp:71
bool wasThisDeclarationADefinition(const FunctionDecl *FD) override
True if this function declaration was a definition before in its own module.
Definition MultiplexExternalSemaSource.cpp:103
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...
Definition MultiplexExternalSemaSource.cpp:340
bool LookupUnqualified(LookupResult &R, Scope *S) override
Do last resort, unqualified lookup on a LookupResult that Sema cannot find.
Definition MultiplexExternalSemaSource.cpp:265
void ReadDelegatingConstructors(SmallVectorImpl< CXXConstructorDecl * > &Decls) override
Read the set of delegating constructors known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:284
void AddSource(llvm::IntrusiveRefCntPtr< ExternalSemaSource > Source)
Appends new source to the source list.
Definition MultiplexExternalSemaSource.cpp:33
ExtKind hasExternalDefinitions(const Decl *D) override
Definition MultiplexExternalSemaSource.cpp:95
void ReadMismatchingDeleteExpressions(llvm::MapVector< FieldDecl *, llvm::SmallVector< std::pair< SourceLocation, bool >, 4 > > &Exprs) override
Definition MultiplexExternalSemaSource.cpp:257
void ReadUnusedFileScopedDecls(SmallVectorImpl< const DeclaratorDecl * > &Decls) override
Read the set of unused file-scope declarations known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:278
void ReadDeclsToCheckForDeferredDiags(llvm::SmallSetVector< Decl *, 4 > &Decls) override
Read the set of decls to be checked for deferred diags.
Definition MultiplexExternalSemaSource.cpp:296
Selector GetExternalSelector(uint32_t ID) override
Resolve a selector ID into a selector.
Definition MultiplexExternalSemaSource.cpp:54
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.
Definition MultiplexExternalSemaSource.cpp:78
void ReadTentativeDefinitions(SmallVectorImpl< VarDecl * > &Defs) override
Read the set of tentative definitions known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:272
void ReadUndefinedButUsed(llvm::MapVector< NamedDecl *, SourceLocation > &Undefined) override
Load the set of used but not defined functions or variables with internal linkage,...
Definition MultiplexExternalSemaSource.cpp:251
void ReadComments() override
Loads comment ranges.
Definition MultiplexExternalSemaSource.cpp:168
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...
Definition MultiplexExternalSemaSource.cpp:143
void PrintStats() override
Print any statistics that have been gathered regarding the external AST source.
Definition MultiplexExternalSemaSource.cpp:188
void ReadExtVectorDecls(SmallVectorImpl< TypedefNameDecl * > &Decls) override
Read the set of ext_vector type declarations known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:290
void ReadUnusedLocalTypedefNameCandidates(llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override
Read the set of potentially unused typedefs known to the source.
Definition MultiplexExternalSemaSource.cpp:302
void ReadWeakUndeclaredIdentifiers(SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WI) override
Read the set of weak, undeclared identifiers known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:314
void AssignedLambdaNumbering(CXXRecordDecl *Lambda) override
Notify the external source that a lambda was assigned a mangling number.
Definition MultiplexExternalSemaSource.cpp:365
CXXCtorInitializer ** GetExternalCXXCtorInitializers(uint64_t Offset) override
Resolve a handle to a list of ctor initializers into the list of initializers themselves.
Definition MultiplexExternalSemaSource.cpp:87
void CompleteType(TagDecl *Tag) override
Gives the external AST source an opportunity to complete an incomplete type.
Definition MultiplexExternalSemaSource.cpp:158
void ReadUsedVTables(SmallVectorImpl< ExternalVTableUse > &VTables) override
Read the set of used vtables known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:320
void StartedDeserializing() override
Notify ExternalASTSource that we started deserialization of a decl or type so until FinishedDeseriali...
Definition MultiplexExternalSemaSource.cpp:173
void FinishedDeserializing() override
Notify ExternalASTSource that we finished the deserialization of a decl or type.
Definition MultiplexExternalSemaSource.cpp:178
bool MaybeDiagnoseMissingCompleteType(SourceLocation Loc, QualType T) override
Produces a diagnostic note if one of the attached sources contains a complete definition for T.
Definition MultiplexExternalSemaSource.cpp:356
void ReadMethodPool(Selector Sel) override
Load the contents of the global method pool for a given selector.
Definition MultiplexExternalSemaSource.cpp:235
void InitializeSema(Sema &S) override
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the ...
Definition MultiplexExternalSemaSource.cpp:225
void CompleteRedeclChain(const Decl *D) override
Complete the redeclaration chain if it's been extended since the previous generation of the AST sourc...
Definition MultiplexExternalSemaSource.cpp:49
Decl * GetExternalDecl(GlobalDeclID ID) override
Resolve a declaration ID into a declaration, potentially building a new declaration.
Definition MultiplexExternalSemaSource.cpp:42
void completeVisibleDeclsMap(const DeclContext *DC) override
Ensures that the table of all visible declarations inside this context is up to date.
Definition MultiplexExternalSemaSource.cpp:138
uint32_t GetNumExternalSelectors() override
Returns the number of selectors known to the external AST source.
Definition MultiplexExternalSemaSource.cpp:64
bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name, const DeclContext *OriginalDC) override
Find all declarations with the given name in the given context.
Definition MultiplexExternalSemaSource.cpp:111
void ReadReferencedSelectors(SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) override
Read the set of referenced selectors known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:308
void StartTranslationUnit(ASTConsumer *Consumer) override
Function that will be invoked when we begin parsing a new translation unit involving this external AS...
Definition MultiplexExternalSemaSource.cpp:183
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.
Definition MultiplexExternalSemaSource.cpp:200
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...
Definition MultiplexExternalSemaSource.cpp:245
MultiplexExternalSemaSource(llvm::IntrusiveRefCntPtr< ExternalSemaSource > S1, llvm::IntrusiveRefCntPtr< ExternalSemaSource > S2)
Constructs a new multiplexing external sema source and appends the given element to it.
Definition MultiplexExternalSemaSource.cpp:22
Module * getModule(unsigned ID) override
Retrieve the module that corresponds to the given module ID.
Definition MultiplexExternalSemaSource.cpp:193
void ReadPendingInstantiations(SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) override
Read the set of pending instantiations known to the external Sema source.
Definition MultiplexExternalSemaSource.cpp:326
void ForgetSema() override
Inform the semantic consumer that Sema is no longer available.
Definition MultiplexExternalSemaSource.cpp:230
Represents an ObjC class declaration.
Represents a pointer to an Objective C object.
A (possibly-)qualified type.
Represents a struct/union/class.
Scope - A scope is a transient data structure that is used while parsing the program.
Smart pointer class that efficiently represents Objective-C method names.
bool isNull() const
Determine whether this is the empty selector.
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
Stmt - This represents one statement.
Represents the declaration of a struct/union/class/enum.
Simple class containing the result of Sema::CorrectTypo.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
const FunctionProtoType * T
@ Class
The "class" keyword introduces the elaborated-type-specifier.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...