================
@@ -1061,6 +1070,16 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, 
StringRef InFile) {
     CI.getPreprocessor().addPPCallbacks(std::move(Callbacks));
   }
 
+  if (CI.getFrontendOpts().GenReducedBMI &&
+      !CI.getFrontendOpts().ModuleOutputPath.empty()) {
+    std::vector<std::unique_ptr<ASTConsumer>> Consumers{2};
+    Consumers[0] = std::make_unique<ReducedBMIGenerator>(
+        CI.getPreprocessor(), CI.getModuleCache(),
+        CI.getFrontendOpts().ModuleOutputPath);
+    Consumers[1] = std::move(Result);
+    return std::make_unique<MultiplexConsumer>(std::move(Consumers));
+  }
----------------
dwblaikie wrote:

Why is this new code, rather than an alternative codepath of existing code? 
(like some code that was producing the BMI would go from producing the 
unreduced BMI to producing the reduced BMI)

Figuring this out would help me unedrstand why `ModuleOutputPath` is new (this 
patch doesn't add the functionality to output a module to a path - we had that 
already, this just changes the content that goes there)

I guess because maybe this patch is changing the way we output the BMI - or 
that the reduced BMI is being output in a different way than the non-reduced 
BMI?

Should we address that? Make the current full BMI emission work the same way as 
the reduced BMI? (or, more precisely, in a pre-patch, change the full BMI 
emission to use a mechanism that can then be reused for the reduced BMI?)

https://github.com/llvm/llvm-project/pull/85050
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to