diff options
| author | Ao Li <leeleo3x@gmail.com> | 2024-01-05 15:59:11 -0500 |
|---|---|---|
| committer | Ao Li <leeleo3x@gmail.com> | 2024-01-05 15:59:11 -0500 |
| commit | c9276ea042bda9f11e4ca26428d57ea3701f7bc0 (patch) | |
| tree | f72f2cf7d11cb8f1e4e06c71b04cfe2914fd4ae2 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 11035f9f52c65739d9613f5b9ecd332e9e640e71 (diff) | |
| download | rust-c9276ea042bda9f11e4ca26428d57ea3701f7bc0.tar.gz rust-c9276ea042bda9f11e4ca26428d57ea3701f7bc0.zip | |
Pass LLVM error message back to pass wrapper.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index cf3f526400d..76eb6bfaef7 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -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); |
