diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-30 13:28:52 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-30 13:30:31 +0800 |
commit | 18268ac0f48d93c2bcddb69732761971669c09ab (patch) | |
tree | e4872e9710f71d7c242bafc88ff1add59f35e06b /clang/lib/Frontend/FrontendActions.cpp | |
parent | bd72f7b0ab98531ab579fafe79c7a8967994583a (diff) | |
download | llvm-18268ac0f48d93c2bcddb69732761971669c09ab.zip llvm-18268ac0f48d93c2bcddb69732761971669c09ab.tar.gz llvm-18268ac0f48d93c2bcddb69732761971669c09ab.tar.bz2 |
[NFC] [C++20] [Modules] Use new class CXX20ModulesGenerator to generate module file for C++20 modules instead of PCHGenerator
Previously we're re-using PCHGenerator to generate the module file for
C++20 modules. But this is slighty more or less odd. This patch tries
to use a new class 'CXX20ModulesGenerator' to generate the module file
for C++20 modules.
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 04eb104..454653a 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -272,14 +272,10 @@ bool GenerateModuleInterfaceAction::BeginSourceFileAction( std::unique_ptr<ASTConsumer> GenerateModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - CI.getHeaderSearchOpts().ModulesSkipDiagnosticOptions = true; - CI.getHeaderSearchOpts().ModulesSkipHeaderSearchPaths = true; - CI.getHeaderSearchOpts().ModulesSkipPragmaDiagnosticMappings = true; - - std::vector<std::unique_ptr<ASTConsumer>> Consumers = - CreateMultiplexConsumer(CI, InFile); - if (Consumers.empty()) - return nullptr; + std::vector<std::unique_ptr<ASTConsumer>> Consumers; + Consumers.push_back(std::make_unique<CXX20ModulesGenerator>( + CI.getPreprocessor(), CI.getModuleCache(), + CI.getFrontendOpts().OutputFile)); if (CI.getFrontendOpts().GenReducedBMI && !CI.getFrontendOpts().ModuleOutputPath.empty()) { |