[clang] [C++20] [Modules] Introduce reduced BMI (PR #75894)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 18 21:44:04 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff cdc03926696d674c6aa61b55d5b509d7118ed023 6354bb468098f25b869deae3a475bf6bcfe37d40 -- clang/include/clang/Frontend/FrontendActions.h clang/include/clang/Frontend/FrontendOptions.h clang/include/clang/Serialization/ASTWriter.h clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Frontend/FrontendActions.cpp clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp clang/lib/Serialization/ASTWriter.cpp clang/lib/Serialization/ASTWriterDecl.cpp clang/lib/Serialization/GeneratePCH.cpp clang/test/CXX/basic/basic.link/p10-ex2.cpp clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4-friend-in-reachable-class.cpp clang/test/Modules/InheritDefaultArguments.cppm clang/test/Modules/Reachability-Private.cpp clang/test/Modules/Reachability-func-default-arg.cpp clang/test/Modules/Reachability-func-ret.cpp clang/test/Modules/Reachability-template-default-arg.cpp clang/test/Modules/Reachability-template-instantiation.cpp clang/test/Modules/Reachability-using-templates.cpp clang/test/Modules/Reachability-using.cpp clang/test/Modules/concept.cppm clang/test/Modules/concept_differ.cppm clang/test/Modules/ctor.arg.dep.cppm clang/test/Modules/cxx20-10-1-ex1.cpp clang/test/Modules/cxx20-10-1-ex2.cpp clang/test/Modules/cxx20-10-2-ex2.cpp clang/test/Modules/cxx20-10-2-ex5.cpp clang/test/Modules/cxx20-10-3-ex1.cpp clang/test/Modules/cxx20-10-3-ex2.cpp clang/test/Modules/cxx20-10-5-ex1.cpp clang/test/Modules/cxx20-import-diagnostics-a.cpp clang/test/Modules/cxx20-import-diagnostics-b.cpp clang/test/Modules/cxx20-module-file-info-macros.cpp clang/test/Modules/deduction-guide.cppm clang/test/Modules/deduction-guide2.cppm clang/test/Modules/deduction-guide3.cppm clang/test/Modules/derived_class.cpp clang/test/Modules/duplicated-module-file-eq-module-name.cppm clang/test/Modules/enum-class.cppm clang/test/Modules/explicitly-specialized-template.cpp clang/test/Modules/export-language-linkage.cppm clang/test/Modules/ftime-trace.cppm clang/test/Modules/inconsistent-deduction-guide-linkage.cppm clang/test/Modules/inconsistent-export.cppm clang/test/Modules/inherited_arg.cppm clang/test/Modules/instantiation-argdep-lookup.cppm clang/test/Modules/lambdas.cppm clang/test/Modules/merge-concepts-cxx-modules.cpp clang/test/Modules/merge-constrained-friends.cpp clang/test/Modules/merge-lambdas.cppm clang/test/Modules/merge-requires-with-lambdas.cppm clang/test/Modules/merge-var-template-spec-cxx-modules.cppm clang/test/Modules/mismatch-diagnostics.cpp clang/test/Modules/module-init-duplicated-import.cppm clang/test/Modules/named-modules-adl-2.cppm clang/test/Modules/named-modules-adl-3.cppm clang/test/Modules/named-modules-adl.cppm clang/test/Modules/no-duplicate-codegen-in-GMF.cppm clang/test/Modules/pair-unambiguous-ctor.cppm clang/test/Modules/partial_specialization.cppm clang/test/Modules/placement-new-reachable.cpp clang/test/Modules/polluted-operator.cppm clang/test/Modules/pr54457.cppm clang/test/Modules/pr56916.cppm clang/test/Modules/pr58532.cppm clang/test/Modules/pr58716.cppm clang/test/Modules/pr59719.cppm clang/test/Modules/pr59780.cppm clang/test/Modules/pr59999.cppm clang/test/Modules/pr60036.cppm clang/test/Modules/pr60085.cppm clang/test/Modules/pr60275.cppm clang/test/Modules/pr60486.cppm clang/test/Modules/pr60693.cppm clang/test/Modules/pr60775.cppm clang/test/Modules/pr60890.cppm clang/test/Modules/pr61065.cppm clang/test/Modules/pr61065_2.cppm clang/test/Modules/pr61067.cppm clang/test/Modules/pr61317.cppm clang/test/Modules/pr61783.cppm clang/test/Modules/pr61892.cppm clang/test/Modules/pr62158.cppm clang/test/Modules/pr62359.cppm clang/test/Modules/pr62589.cppm clang/test/Modules/pr62705.cppm clang/test/Modules/pr62796.cppm clang/test/Modules/pr62943.cppm clang/test/Modules/pr63544.cppm clang/test/Modules/pr63595.cppm clang/test/Modules/pr67627.cppm clang/test/Modules/pr67893.cppm clang/test/Modules/predefined.cpp clang/test/Modules/preferred_name.cppm clang/test/Modules/redefinition-merges.cppm clang/test/Modules/redundant-template-default-arg.cpp clang/test/Modules/redundant-template-default-arg2.cpp clang/test/Modules/redundant-template-default-arg3.cpp clang/test/Modules/search-partitions.cpp clang/test/Modules/seperated-member-function-definition-for-template-class.cppm clang/test/Modules/template-function-specialization.cpp clang/test/Modules/template-lambdas.cppm clang/test/Modules/template-pack.cppm clang/test/Modules/template_default_argument.cpp clang/unittests/Sema/SemaNoloadLookupTest.cpp clang/unittests/Serialization/ForceCheckFileInputTest.cpp clang/unittests/Serialization/NoCommentsTest.cpp clang/unittests/Serialization/VarDeclConstantInitTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h
index 87cc31a72d..90b566ae37 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -846,8 +846,8 @@ public:
 class ReducedBMIGenerator : public PCHGenerator {
 public:
   ReducedBMIGenerator(const Preprocessor &PP, InMemoryModuleCache &ModuleCache,
-                   StringRef OutputFile, std::shared_ptr<PCHBuffer> Buffer,
-                   bool IncludeTimestamps);
+                      StringRef OutputFile, std::shared_ptr<PCHBuffer> Buffer,
+                      bool IncludeTimestamps);
 
   void HandleTranslationUnit(ASTContext &Ctx) override;
 };
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index ffaf3db5fd..968fbbb612 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2567,7 +2567,8 @@ static const auto &getFrontendActionTable() {
 
       {frontend::GenerateModule, OPT_emit_module},
       {frontend::GenerateModuleInterface, OPT_emit_module_interface},
-      {frontend::GenerateThinModuleInterface, OPT_emit_reduced_module_interface},
+      {frontend::GenerateThinModuleInterface,
+       OPT_emit_reduced_module_interface},
       {frontend::GenerateHeaderUnit, OPT_emit_header_unit},
       {frontend::GeneratePCH, OPT_emit_pch},
       {frontend::GenerateInterfaceStubs, OPT_emit_interface_stubs},
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index c9a0b6858a..a9ebb866af 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -295,7 +295,8 @@ GenerateThinModuleInterfaceAction::CreateASTConsumer(CompilerInstance &CI,
                                                      StringRef InFile) {
   auto Buffer = std::make_shared<PCHBuffer>();
   return std::make_unique<ReducedBMIGenerator>(
-      CI.getPreprocessor(), CI.getModuleCache(), CI.getFrontendOpts().OutputFile, Buffer,
+      CI.getPreprocessor(), CI.getModuleCache(),
+      CI.getFrontendOpts().OutputFile, Buffer,
       /*IncludeTimestamps=*/+CI.getFrontendOpts().IncludeTimestamps);
 }
 
diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp
index c4c2ac98b3..2b511b2d5a 100644
--- a/clang/lib/Serialization/GeneratePCH.cpp
+++ b/clang/lib/Serialization/GeneratePCH.cpp
@@ -83,10 +83,10 @@ ASTDeserializationListener *PCHGenerator::GetASTDeserializationListener() {
 }
 
 ReducedBMIGenerator::ReducedBMIGenerator(const Preprocessor &PP,
-                                   InMemoryModuleCache &ModuleCache,
-                                   StringRef OutputFile,
-                                   std::shared_ptr<PCHBuffer> Buffer,
-                                   bool IncludeTimestamps)
+                                         InMemoryModuleCache &ModuleCache,
+                                         StringRef OutputFile,
+                                         std::shared_ptr<PCHBuffer> Buffer,
+                                         bool IncludeTimestamps)
     : PCHGenerator(
           PP, ModuleCache, OutputFile, llvm::StringRef(), Buffer,
           /*Extensions=*/ArrayRef<std::shared_ptr<ModuleFileExtension>>(),

``````````

</details>


https://github.com/llvm/llvm-project/pull/75894


More information about the cfe-commits mailing list