Pass LLVM error message back to pass wrapper.

This commit is contained in:
Ao Li 2024-01-05 15:59:11 -05:00
parent 11035f9f52
commit c9276ea042
1 changed files with 3 additions and 1 deletions

View File

@ -787,7 +787,9 @@ LLVMRustOptimize(
for (auto PluginPath: Plugins) {
auto Plugin = PassPlugin::Load(PluginPath.str());
if (!Plugin) {
LLVMRustSetLastError(("Failed to load pass plugin" + PluginPath.str()).c_str());
auto Err = Plugin.takeError();
auto ErrMsg = llvm::toString(std::move(Err));
LLVMRustSetLastError(ErrMsg.c_str());
return LLVMRustResult::Failure;
}
Plugin->registerPassBuilderCallbacks(PB);