summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
committerpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
commitb773203fb58f3ef282fb69c832d8710cab5bc82d (patch)
treee75913f147570fbd75169647b144df85b88a038c /gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp
parenttweak errno in previous (diff)
downloadwireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz
wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp')
-rw-r--r--gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp b/gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp
index 77ace0cfa57..50808effe00 100644
--- a/gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp
+++ b/gnu/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp
@@ -16,7 +16,7 @@
using namespace clang;
-///\brief Constructs a new multiplexing external sema source and appends the
+///Constructs a new multiplexing external sema source and appends the
/// given element to it.
///
MultiplexExternalSemaSource::MultiplexExternalSemaSource(ExternalSemaSource &s1,
@@ -28,7 +28,7 @@ MultiplexExternalSemaSource::MultiplexExternalSemaSource(ExternalSemaSource &s1,
// pin the vtable here.
MultiplexExternalSemaSource::~MultiplexExternalSemaSource() {}
-///\brief Appends new source to the source list.
+///Appends new source to the source list.
///
///\param[in] source - An ExternalSemaSource.
///
@@ -121,7 +121,7 @@ void MultiplexExternalSemaSource::FindExternalLexicalDecls(
Sources[i]->FindExternalLexicalDecls(DC, IsKindWeWant, Result);
}
-void MultiplexExternalSemaSource::FindFileRegionDecls(FileID File,
+void MultiplexExternalSemaSource::FindFileRegionDecls(FileID File,
unsigned Offset,
unsigned Length,
SmallVectorImpl<Decl *> &Decls){
@@ -164,14 +164,28 @@ void MultiplexExternalSemaSource::PrintStats() {
Sources[i]->PrintStats();
}
+Module *MultiplexExternalSemaSource::getModule(unsigned ID) {
+ for (size_t i = 0; i < Sources.size(); ++i)
+ if (auto M = Sources[i]->getModule(ID))
+ return M;
+ return nullptr;
+}
+
+bool MultiplexExternalSemaSource::DeclIsFromPCHWithObjectFile(const Decl *D) {
+ for (auto *S : Sources)
+ if (S->DeclIsFromPCHWithObjectFile(D))
+ return true;
+ return false;
+}
+
bool MultiplexExternalSemaSource::layoutRecordType(const RecordDecl *Record,
- uint64_t &Size,
+ 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){
for(size_t i = 0; i < Sources.size(); ++i)
- if (Sources[i]->layoutRecordType(Record, Size, Alignment, FieldOffsets,
+ if (Sources[i]->layoutRecordType(Record, Size, Alignment, FieldOffsets,
BaseOffsets, VirtualBaseOffsets))
return true;
return false;
@@ -229,10 +243,10 @@ void MultiplexExternalSemaSource::ReadMismatchingDeleteExpressions(
Source->ReadMismatchingDeleteExpressions(Exprs);
}
-bool MultiplexExternalSemaSource::LookupUnqualified(LookupResult &R, Scope *S){
+bool MultiplexExternalSemaSource::LookupUnqualified(LookupResult &R, Scope *S){
for(size_t i = 0; i < Sources.size(); ++i)
Sources[i]->LookupUnqualified(R, S);
-
+
return !R.empty();
}
@@ -241,13 +255,13 @@ void MultiplexExternalSemaSource::ReadTentativeDefinitions(
for(size_t i = 0; i < Sources.size(); ++i)
Sources[i]->ReadTentativeDefinitions(TentativeDefs);
}
-
+
void MultiplexExternalSemaSource::ReadUnusedFileScopedDecls(
SmallVectorImpl<const DeclaratorDecl*> &Decls) {
for(size_t i = 0; i < Sources.size(); ++i)
Sources[i]->ReadUnusedFileScopedDecls(Decls);
}
-
+
void MultiplexExternalSemaSource::ReadDelegatingConstructors(
SmallVectorImpl<CXXConstructorDecl*> &Decls) {
for(size_t i = 0; i < Sources.size(); ++i)