Rollup merge of #104517 - dfordivam:patch-1, r=cuviper

Throw error on failure in loading llvm-plugin

The following code silently ignores the error as the `LLVMRustSetLastError` only tracks one error at a time. At all other places where `LLVMRustSetLastError` is used the code immediately returns.

251831ece9/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp (L801-L804)
This commit is contained in:
Matthias Krüger 2022-11-24 08:42:33 +01:00 committed by GitHub
commit 1e0df8827b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -800,7 +800,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);
}