diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2025-05-09 08:33:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-09 08:33:28 -0700 |
commit | 49c513844db2e1513827a7c5b3c08acf87cfbd2b (patch) | |
tree | 295bcc0edfb30ac1a378199fb64bc0c91739aaac /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 51ca3cbb2b91a0361620248b6e3e22da1a68eb69 (diff) | |
download | llvm-49c513844db2e1513827a7c5b3c08acf87cfbd2b.zip llvm-49c513844db2e1513827a7c5b3c08acf87cfbd2b.tar.gz llvm-49c513844db2e1513827a7c5b3c08acf87cfbd2b.tar.bz2 |
[clang][modules] Allow not forcing validation of user headers (#139091)
Force-validation of user headers was implemented in acb803e8 to deal
with files changing during build. The dependency scanner guarantees an
immutable file system during single build session, so the validation is
unnecessary. (We don't hit the disk too often due to the caching VFS,
but even avoiding going to the cache and deserializing the input files
makes sense.)
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index b59496b..503d364 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -638,8 +638,9 @@ IntrusiveRefCntPtr<ASTReader> CompilerInstance::createPCHExternalASTSource( PP, ModCache, &Context, PCHContainerRdr, Extensions, Sysroot.empty() ? "" : Sysroot.data(), DisableValidation, AllowPCHWithCompilerErrors, /*AllowConfigurationMismatch*/ false, - HSOpts.ModulesValidateSystemHeaders, HSOpts.ValidateASTInputFilesContent, - UseGlobalModuleIndex)); + HSOpts.ModulesValidateSystemHeaders, + HSOpts.ModulesForceValidateUserHeaders, + HSOpts.ValidateASTInputFilesContent, UseGlobalModuleIndex)); // We need the external source to be set up before we read the AST, because // eagerly-deserialized declarations may use it. @@ -1752,6 +1753,7 @@ void CompilerInstance::createASTReader() { PPOpts.DisablePCHOrModuleValidation, /*AllowASTWithCompilerErrors=*/FEOpts.AllowPCMWithCompilerErrors, /*AllowConfigurationMismatch=*/false, HSOpts.ModulesValidateSystemHeaders, + HSOpts.ModulesForceValidateUserHeaders, HSOpts.ValidateASTInputFilesContent, getFrontendOpts().UseGlobalModuleIndex, std::move(ReadTimer)); if (hasASTConsumer()) { |