Skip to content

Commit c9276ea

Browse files
committed
Pass LLVM error message back to pass wrapper.
1 parent 11035f9 commit c9276ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,9 @@ LLVMRustOptimize(
787787
for (auto PluginPath: Plugins) {
788788
auto Plugin = PassPlugin::Load(PluginPath.str());
789789
if (!Plugin) {
790-
LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
790+
auto Err = Plugin.takeError();
791+
auto ErrMsg = llvm::toString(std::move(Err));
792+
LLVMRustSetLastError(ErrMsg.c_str());
791793
return LLVMRustResult::Failure;
792794
}
793795
Plugin->registerPassBuilderCallbacks(PB);

0 commit comments

Comments
 (0)