diff options
| author | Ben Langmuir <blangmuir@apple.com> | 2014-03-12 00:06:17 +0000 |
|---|---|---|
| committer | Ben Langmuir <blangmuir@apple.com> | 2014-03-12 00:06:17 +0000 |
| commit | 310c3dc9ef15c47ef8c0d55ac48ea6e2ca67396d (patch) | |
| tree | a6f2ee20ae4b299eabfaeee21b5b6f046ace4c99 /lib/Frontend/CompilerInstance.cpp | |
| parent | 4bfb063cae5d2dbe59778bbcd7fea4ca143c7743 (diff) | |
| download | clang-310c3dc9ef15c47ef8c0d55ac48ea6e2ca67396d.tar.gz clang-310c3dc9ef15c47ef8c0d55ac48ea6e2ca67396d.tar.bz2 clang-310c3dc9ef15c47ef8c0d55ac48ea6e2ca67396d.tar.xz | |
Add an option -fmodules-validate-system-headers
When enabled, always validate the system headers when loading a module.
The end result of this is that when these headers change, we will notice
and rebuild the module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
| -rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 11b5ba9f54..ce47674edb 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -334,13 +334,15 @@ CompilerInstance::createPCHExternalASTSource(StringRef Path, void *DeserializationListener, bool Preamble, bool UseGlobalModuleIndex) { + HeaderSearchOptions &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts(); + std::unique_ptr<ASTReader> Reader; Reader.reset(new ASTReader(PP, Context, Sysroot.empty() ? "" : Sysroot.c_str(), DisablePCHValidation, AllowPCHWithCompilerErrors, /*AllowConfigurationMismatch*/false, - /*ValidateSystemInputs*/false, + HSOpts.ModulesValidateSystemHeaders, UseGlobalModuleIndex)); Reader->setDeserializationListener( @@ -1141,14 +1143,15 @@ CompilerInstance::loadModule(SourceLocation ImportLoc, pruneModuleCache(getHeaderSearchOpts()); } - std::string Sysroot = getHeaderSearchOpts().Sysroot; + HeaderSearchOptions &HSOpts = getHeaderSearchOpts(); + std::string Sysroot = HSOpts.Sysroot; const PreprocessorOptions &PPOpts = getPreprocessorOpts(); ModuleManager = new ASTReader(getPreprocessor(), *Context, Sysroot.empty() ? "" : Sysroot.c_str(), PPOpts.DisablePCHValidation, /*AllowASTWithCompilerErrors=*/false, /*AllowConfigurationMismatch=*/false, - /*ValidateSystemInputs=*/false, + HSOpts.ModulesValidateSystemHeaders, getFrontendOpts().UseGlobalModuleIndex); if (hasASTConsumer()) { ModuleManager->setDeserializationListener( |
