Skip to content

Commit

Permalink
Rollup merge of #104517 - dfordivam:patch-1, r=cuviper
Browse files Browse the repository at this point in the history
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.

https://github.com/rust-lang/rust/blob/251831ece9601d64172127b6caae9087358c2386/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L801-L804
  • Loading branch information
matthiaskrgr authored Nov 24, 2022
2 parents 5197ef6 + 693c631 commit 1e0df88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1e0df88

Please sign in to comment.