aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2024-03-07 11:07:59 -0800
committerLang Hames <lhames@gmail.com>2024-03-07 11:30:18 -0800
commit4d31fbbb5af6528387fd5efd90363a408713108b (patch)
tree34a5f5a235c7f328101f3c7b0b21eab493b92155 /llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
parentd64632becd159a4b816af2d5a01fd3531bd45f65 (diff)
downloadllvm-4d31fbbb5af6528387fd5efd90363a408713108b.zip
llvm-4d31fbbb5af6528387fd5efd90363a408713108b.tar.gz
llvm-4d31fbbb5af6528387fd5efd90363a408713108b.tar.bz2
[ORC] Propagate defineMaterializing failure when resource tracker is defunct.
Remove an overly aggressive cantFail: This call to defineMaterializing should never fail with a duplicate symbols error (since all new symbols shoul be weak), but may fail if the tracker has become defunct in the mean time. In that case we need to propagate the error.
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
index fffa95e..6ac256d 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
@@ -455,9 +455,10 @@ private:
ProcessSymbol(Sym);
// Attempt to claim all weak defs that we're not already responsible for.
- // This cannot fail -- any clashes will just result in rejection of our
- // claim, at which point we'll externalize that symbol.
- cantFail(MR->defineMaterializing(std::move(NewSymbolsToClaim)));
+ // This may fail if the resource tracker has become defunct, but should
+ // always succeed otherwise.
+ if (auto Err = MR->defineMaterializing(std::move(NewSymbolsToClaim)))
+ return Err;
// Walk the list of symbols that we just tried to claim. Symbols that we're
// responsible for are marked live. Symbols that we're not responsible for