about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back
diff options
context:
space:
mode:
authorAxel Cohen <axel.cohen@eshard.com>2021-11-19 17:01:41 +0100
committerAxel Cohen <axel.cohen@eshard.com>2021-12-13 10:40:44 +0100
commit97cf461b8f4c0ed0de8fdc1c441b904ddb8b3194 (patch)
tree436752a1ffb01de4304b68790df0579062e3b10d /compiler/rustc_codegen_llvm/src/back
parent4a7fb971c939d268abdbd0963cd45d046442f7af (diff)
downloadrust-97cf461b8f4c0ed0de8fdc1c441b904ddb8b3194.tar.gz
rust-97cf461b8f4c0ed0de8fdc1c441b904ddb8b3194.zip
Add a codegen option to allow loading LLVM pass plugins
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/back')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/write.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
index fa4fad30830..a28fca3e700 100644
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
@@ -470,6 +470,8 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
 
     let extra_passes = config.passes.join(",");
 
+    let pass_plugins = config.pass_plugins.join(" ");
+
     // FIXME: NewPM doesn't provide a facility to pass custom InlineParams.
     // We would have to add upstream support for this first, before we can support
     // config.inline_threshold and our more aggressive default thresholds.
@@ -499,6 +501,8 @@ pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(
         selfprofile_after_pass_callback,
         extra_passes.as_ptr().cast(),
         extra_passes.len(),
+        pass_plugins.as_ptr().cast(),
+        pass_plugins.len(),
     );
     result.into_result().map_err(|()| llvm_err(diag_handler, "failed to run LLVM passes"))
 }