diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-03-14 04:44:56 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-03-14 04:44:56 +0000 |
| commit | ffb3558beb087304e3173e5076c56f634f76e5eb (patch) | |
| tree | b77fe69b15e1195620d2d043fa7634b93f82407e | |
| parent | 0e0d00976fa0e26eb0778ec1b638b5d89fb2240a (diff) | |
| download | bcm5719-llvm-ffb3558beb087304e3173e5076c56f634f76e5eb.tar.gz bcm5719-llvm-ffb3558beb087304e3173e5076c56f634f76e5eb.zip | |
[modules] Check for delegating constructor cycles when building a module and don't write them out to the module file.
llvm-svn: 177000
| -rw-r--r-- | clang/lib/Sema/Sema.cpp | 12 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 9 |
2 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 09ea825e1ae..0ddd0619f92 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -616,6 +616,12 @@ void Sema::ActOnEndOfTranslationUnit() { << I->first; } + if (LangOpts.CPlusPlus11 && + Diags.getDiagnosticLevel(diag::warn_delegating_ctor_cycle, + SourceLocation()) + != DiagnosticsEngine::Ignored) + CheckDelegatingCtorCycles(); + if (TUKind == TU_Module) { // If we are building a module, resolve all of the exported declarations // now. @@ -700,12 +706,6 @@ void Sema::ActOnEndOfTranslationUnit() { } - if (LangOpts.CPlusPlus11 && - Diags.getDiagnosticLevel(diag::warn_delegating_ctor_cycle, - SourceLocation()) - != DiagnosticsEngine::Ignored) - CheckDelegatingCtorCycles(); - // If there were errors, disable 'unused' warnings since they will mostly be // noise. if (!Diags.hasErrorOccurred()) { diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 088e7a3f2cf..58a196d9a1a 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3464,6 +3464,8 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, Module *WritingModule) { using namespace llvm; + bool isModule = WritingModule != 0; + // Make sure that the AST reader knows to finalize itself. if (Chain) Chain->finalizeForWriting(); @@ -3535,7 +3537,8 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, // Build a record containing all of the delegating constructors we still need // to resolve. RecordData DelegatingCtorDecls; - AddLazyVectorDecls(*this, SemaRef.DelegatingCtorDecls, DelegatingCtorDecls); + if (!isModule) + AddLazyVectorDecls(*this, SemaRef.DelegatingCtorDecls, DelegatingCtorDecls); // Write the set of weak, undeclared identifiers. We always write the // entire table, since later PCH files in a PCH chain are only interested in @@ -3770,11 +3773,11 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, Stream.EmitRecordWithBlob(ModuleOffsetMapAbbrev, Record, Buffer.data(), Buffer.size()); } - WritePreprocessor(PP, WritingModule != 0); + WritePreprocessor(PP, isModule); WriteHeaderSearch(PP.getHeaderSearchInfo(), isysroot); WriteSelectors(SemaRef); WriteReferencedSelectorsPool(SemaRef); - WriteIdentifierTable(PP, SemaRef.IdResolver, WritingModule != 0); + WriteIdentifierTable(PP, SemaRef.IdResolver, isModule); WriteFPPragmaOptions(SemaRef.getFPOptions()); WriteOpenCLExtensions(SemaRef); |

