================
@@ -233,6 +234,20 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
 
   Clang->LoadRequestedPlugins();
 
+  // Load and store pass plugins for the back-end. Store the loaded pass 
plugins
+  // here and store references to these in CodeGenOpts to avoid pulling in the
+  // entire PassPlugin dependency chain in CodeGenOpts.
+  std::vector<std::unique_ptr<llvm::PassPlugin>> PassPlugins;
+  for (const std::string &Path : Clang->getCodeGenOpts().PassPluginNames) {
----------------
aengelke wrote:

llvm::PassPlugin works differently from front-end plugins in that they don't 
register themselves anywhere but just expose a function that returns 
information about the plugin (stored in llvm::PassPlugin). This information 
contains a function pointer, which is expected to be called when the pass 
pipeline is built.

However, pass plugins do register their llvm::cl options when loaded, but 
currently, they are only loaded in EmitAssemblyHelper::RunOptimizationPipeline, 
which is long after the LLVM options have been parsed (which is done here).

https://github.com/llvm/llvm-project/pull/171868
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to