]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Rollup merge of #104936 - cjgillot:self-rpit-orig-too, r=oli-obk
[rust.git] / compiler / rustc_llvm / llvm-wrapper / PassWrapper.cpp
index 18d37d95a83575dc5e61f5f86364a402dcc916ed..7f4d63eed8bdf225c8e3ea7ea7d3a17a80f790ed 100644 (file)
@@ -627,7 +627,11 @@ LLVMRustOptimize(
   bool DebugPassManager = false;
 
   PassInstrumentationCallbacks PIC;
+#if LLVM_VERSION_LT(16, 0)
   StandardInstrumentations SI(DebugPassManager);
+#else
+  StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
+#endif
   SI.registerCallbacks(PIC);
 
   if (LlvmSelfProfiler){
@@ -800,7 +804,7 @@ LLVMRustOptimize(
       auto Plugin = PassPlugin::Load(PluginPath.str());
       if (!Plugin) {
         LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
-        continue;
+        return LLVMRustResult::Failure;
       }
       Plugin->registerPassBuilderCallbacks(PB);
     }