[llvm] d908118 - [llvm-jitlink] Fix a FIXME.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 1 08:53:42 PDT 2021


Author: Lang Hames
Date: 2021-10-01T08:49:51-07:00
New Revision: d908118b8a2690c67daccd02ad0f264a790a7b72

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

LOG: [llvm-jitlink] Fix a FIXME.

ORC errors preserve the SymbolStringPool since 6fe2e9a9cc8, so we can stop
bailing out early.

Added: 
    

Modified: 
    llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 8e678d3d29c96..b521b89901a3d 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -839,10 +839,8 @@ Expected<std::unique_ptr<Session>> Session::Create(Triple TT) {
 
   Error Err = Error::success();
   std::unique_ptr<Session> S(new Session(std::move(EPC), Err));
-
-  // FIXME: Errors destroy the session, leaving the SymbolStringPtrs dangling,
-  // so just exit here. We could fix this by having errors keep the pool alive.
-  ExitOnErr(std::move(Err));
+  if (Err)
+    return std::move(Err);
   return std::move(S);
 }
 


        


More information about the llvm-commits mailing list