aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-03-21 13:52:12 -0700
committerGitHub <noreply@github.com>2025-03-21 13:52:12 -0700
commit7606f6773cb5abe701b615b0bec54e68758955d7 (patch)
treea014df9051c20296753b4681aba82772dd918a06 /clang/lib
parent900be712ce4fe56e2165bfe4e9213b555bfe3887 (diff)
downloadllvm-7606f6773cb5abe701b615b0bec54e68758955d7.zip
llvm-7606f6773cb5abe701b615b0bec54e68758955d7.tar.gz
llvm-7606f6773cb5abe701b615b0bec54e68758955d7.tar.bz2
[clang] NFCI: Mutate `HeaderSearchOptions` earlier (#130823)
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp8
-rw-r--r--clang/lib/Serialization/GeneratePCH.cpp7
2 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b2d8d12..756ae10 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4971,6 +4971,14 @@ bool CompilerInvocation::CreateFromArgsImpl(
llvm::Triple T(Res.getTargetOpts().Triple);
ParseHeaderSearchArgs(Res.getHeaderSearchOpts(), Args, Diags,
Res.getFileSystemOpts().WorkingDir);
+ if (Res.getFrontendOpts().GenReducedBMI ||
+ Res.getFrontendOpts().ProgramAction ==
+ frontend::GenerateReducedModuleInterface ||
+ Res.getFrontendOpts().ProgramAction ==
+ frontend::GenerateModuleInterface) {
+ Res.getHeaderSearchOpts().ModulesSkipDiagnosticOptions = true;
+ Res.getHeaderSearchOpts().ModulesSkipHeaderSearchPaths = true;
+ }
ParseAPINotesArgs(Res.getAPINotesOpts(), Args, Diags);
ParsePointerAuthArgs(LangOpts, Args, Diags);
diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp
index 46ab1be..77317f0 100644
--- a/clang/lib/Serialization/GeneratePCH.cpp
+++ b/clang/lib/Serialization/GeneratePCH.cpp
@@ -120,13 +120,6 @@ Module *CXX20ModulesGenerator::getEmittingModule(ASTContext &Ctx) {
}
void CXX20ModulesGenerator::HandleTranslationUnit(ASTContext &Ctx) {
- // FIMXE: We'd better to wrap such options to a new class ASTWriterOptions
- // since this is not about searching header really.
- HeaderSearchOptions &HSOpts =
- getPreprocessor().getHeaderSearchInfo().getHeaderSearchOpts();
- HSOpts.ModulesSkipDiagnosticOptions = true;
- HSOpts.ModulesSkipHeaderSearchPaths = true;
-
PCHGenerator::HandleTranslationUnit(Ctx);
if (!isComplete())