[llvm] 4d31fbb - [ORC] Propagate defineMaterializing failure when resource tracker is defunct.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 11:30:25 PST 2024


Author: Lang Hames
Date: 2024-03-07T11:30:18-08:00
New Revision: 4d31fbbb5af6528387fd5efd90363a408713108b

URL: https://github.com/llvm/llvm-project/commit/4d31fbbb5af6528387fd5efd90363a408713108b
DIFF: https://github.com/llvm/llvm-project/commit/4d31fbbb5af6528387fd5efd90363a408713108b.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
index fffa95ee72b719..6ac256dff9b436 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
@@ -455,9 +455,10 @@ class ObjectLinkingLayerJITLinkContext final : public JITLinkContext {
       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


        


More information about the llvm-commits mailing list