[llvm-branch-commits] [clang] [Clang] Load pass plugins before parsing LLVM options (PR #171868)
Tarun Prabhu via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 16 06:53:25 PST 2025
================
@@ -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().PassPlugins) {
+ if (auto PassPlugin = llvm::PassPlugin::Load(Path)) {
----------------
tarunprabhu wrote:
Perhaps use an explicit type here instead of `auto`
https://github.com/llvm/llvm-project/pull/171868
More information about the llvm-branch-commits
mailing list