[llvm] b198016 - [ORC] Fix an overly aggressive assert.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 20:05:10 PDT 2020


Author: Lang Hames
Date: 2020-03-11T20:04:54-07:00
New Revision: b19801640bf621a596187d819afb57514713d1e7

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

LOG: [ORC] Fix an overly aggressive assert.

It is ok to add dependencies on symbols that are ready, they should just be
skipped.

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 ef4ab1e68c02..49b7395843a5 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1001,16 +1001,18 @@ void JITDylib::addDependencies(const SymbolStringPtr &Name,
       // Check the sym entry for the dependency.
       auto OtherSymI = OtherJITDylib.Symbols.find(OtherSymbol);
 
-#ifndef NDEBUG
       // Assert that this symbol exists and has not reached the ready state
       // already.
       assert(OtherSymI != OtherJITDylib.Symbols.end() &&
-             (OtherSymI->second.getState() < SymbolState::Ready &&
-              "Dependency on emitted/ready symbol"));
-#endif
+             "Dependency on unknown symbol");
 
       auto &OtherSymEntry = OtherSymI->second;
 
+      // If the other symbol is already in the Ready state then there's no
+      // dependency to add.
+      if (OtherSymEntry.getState() == SymbolState::Ready)
+        continue;
+
       // If the dependency is in an error state then note this and continue,
       // we will move this symbol to the error state below.
       if (OtherSymEntry.getFlags().hasError()) {


        


More information about the llvm-commits mailing list