summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-04-12 20:58:33 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-04-12 20:58:33 +0000
commitf63556d8b44b209e741833b0e6be3f8e72a1d91a (patch)
treeba003bf67e52c55b5e9e1808b07ca4280d39da30 /clang/lib/Serialization/ASTWriter.cpp
parent05bf27ac3f560cc798b20a352450d3b6bc20e72b (diff)
downloadbcm5719-llvm-f63556d8b44b209e741833b0e6be3f8e72a1d91a.tar.gz
bcm5719-llvm-f63556d8b44b209e741833b0e6be3f8e72a1d91a.zip
Modular Codegen: Separate flags for function and debug info support
This allows using and testing these two features separately. (noteably, debug info is, so far as I know, always a win (basically). But function modular codegen is currently a loss for highly optimized code - where most of the linkonce_odr definitions are optimized away, so providing weak_odr definitions is only overhead) llvm-svn: 300104
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 7dd2ca302ca..d52c4fd7706 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4782,7 +4782,7 @@ ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
if (!EagerlyDeserializedDecls.empty())
Stream.EmitRecord(EAGERLY_DESERIALIZED_DECLS, EagerlyDeserializedDecls);
- if (Context.getLangOpts().ModularCodegen)
+ if (!ModularCodegenDecls.empty())
Stream.EmitRecord(MODULAR_CODEGEN_DECLS, ModularCodegenDecls);
// Write the record containing tentative definitions.
@@ -5788,11 +5788,10 @@ void ASTRecordWriter::AddCXXDefinitionData(const CXXRecordDecl *D) {
// getODRHash will compute the ODRHash if it has not been previously computed.
Record->push_back(D->getODRHash());
-
- bool ModularCodegen = Writer->Context->getLangOpts().ModularCodegen &&
- Writer->WritingModule && !D->isDependentType();
- Record->push_back(ModularCodegen);
- if (ModularCodegen)
+ bool ModulesDebugInfo = Writer->Context->getLangOpts().ModulesDebugInfo &&
+ Writer->WritingModule && !D->isDependentType();
+ Record->push_back(ModulesDebugInfo);
+ if (ModulesDebugInfo)
Writer->ModularCodegenDecls.push_back(Writer->GetDeclRef(D));
// IsLambda bit is already saved.
OpenPOWER on IntegriCloud