[clang] [flang] [llvm] [polly] [Plugins] Pass arguments to a pass plugin with -plugin-arg (PR #226773)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 05:39:07 PDT 2026


================
@@ -330,6 +330,15 @@ Makes programs 10x faster by doing Special New Thing.
 
 ### Changes to the LLVM tools
 
+* `opt`, `llc`, and `clang-linker-wrapper` load `-load-pass-plugin` plugins
+  after parsing the command line, so a loaded plugin's options are no longer
+  accepted as ordinary options. Pass them with `-plugin-arg=<plugin>,<arg>`,
+  which calls the plugin's new `PassPluginLibraryInfo::ParseArguments`
+  callback. A plugin that defines `cl::opt` calls `cl::ParseCommandLineOptions`
+  from `ParseArguments`, as the `Bye` example and Polly do.
+  `LLVM_PLUGIN_API_VERSION` is now 3, and `PassPlugin::Load` is renamed to
+  `PassPlugin::load`.
----------------
aengelke wrote:

```suggestion
  callback. A plugin that defines `cl::opt` has to call `cl::ParseCommandLineOptions`
  itself inside `ParseArguments`.
```

Version bumps are not worth documenting, as are minor renames that are not really user-visible.

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


More information about the llvm-commits mailing list