diff options
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 18 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 8 |
2 files changed, 13 insertions, 13 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index ba504540706..d39029ac6fe 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -4328,13 +4328,6 @@ void ASTReader::InitializeSema(Sema &S) { } PreloadedDecls.clear(); - // If there were any delegating constructors, add them to Sema's list - for (unsigned I = 0, N = DelegatingCtorDecls.size(); I != N; ++I) { - CXXConstructorDecl *D - = cast<CXXConstructorDecl>(GetDecl(DelegatingCtorDecls[I])); - SemaObj->DelegatingCtorDecls.push_back(D); - } - // If there were any locally-scoped external declarations, // deserialize them and add them to Sema's table of locally-scoped // external declarations. @@ -4578,6 +4571,17 @@ void ASTReader::ReadUnusedFileScopedDecls( UnusedFileScopedDecls.clear(); } +void ASTReader::ReadDelegatingConstructors( + SmallVectorImpl<CXXConstructorDecl *> &Decls) { + for (unsigned I = 0, N = DelegatingCtorDecls.size(); I != N; ++I) { + CXXConstructorDecl *D + = dyn_cast_or_null<CXXConstructorDecl>(GetDecl(DelegatingCtorDecls[I])); + if (D) + Decls.push_back(D); + } + DelegatingCtorDecls.clear(); +} + void ASTReader::LoadSelector(Selector Sel) { // It would be complicated to avoid reading the methods anyway. So don't. ReadMethodPool(Sel); diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index d604da9c885..44cf99fe0bc 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2822,8 +2822,7 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, UnusedFileScopedDecls); RecordData DelegatingCtorDecls; - for (unsigned i=0, e = SemaRef.DelegatingCtorDecls.size(); i != e; ++i) - AddDeclRef(SemaRef.DelegatingCtorDecls[i], DelegatingCtorDecls); + AddLazyVectorDecls(*this, SemaRef.DelegatingCtorDecls, DelegatingCtorDecls); RecordData WeakUndeclaredIdentifiers; if (!SemaRef.WeakUndeclaredIdentifiers.empty()) { @@ -3089,10 +3088,7 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls, // Build a record containing all of the delegating constructor decls in this // file. RecordData DelegatingCtorDecls; - for (unsigned i=0, e = SemaRef.DelegatingCtorDecls.size(); i != e; ++i) { - if (SemaRef.DelegatingCtorDecls[i]->getPCHLevel() == 0) - AddDeclRef(SemaRef.DelegatingCtorDecls[i], DelegatingCtorDecls); - } + AddLazyVectorDecls(*this, SemaRef.DelegatingCtorDecls, DelegatingCtorDecls); // We write the entire table, overwriting the tables from the chain. RecordData WeakUndeclaredIdentifiers; |