[llvm] 1126cff - [ORC] Assert that ExecutionSession is still open when JITDylibs are created.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 16 16:39:16 PDT 2023


Author: Lang Hames
Date: 2023-07-16T16:37:09-07:00
New Revision: 1126cffe064bf6d72772adf93199637da9de7a87

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

LOG: [ORC] Assert that ExecutionSession is still open when JITDylibs are created.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 1926d60ac015fe..2d9eed1e51e976 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1960,6 +1960,7 @@ JITDylib *ExecutionSession::getJITDylibByName(StringRef Name) {
 JITDylib &ExecutionSession::createBareJITDylib(std::string Name) {
   assert(!getJITDylibByName(Name) && "JITDylib with that name already exists");
   return runSessionLocked([&, this]() -> JITDylib & {
+    assert(SessionOpen && "Cannot create JITDylib after session is closed");
     JDs.push_back(new JITDylib(*this, std::move(Name)));
     return *JDs.back();
   });


        


More information about the llvm-commits mailing list