<div dir="ltr">Hi Dave,<div><br></div><div>I think I broke this out of the global initializers patch as it was getting large already: it's exercised by the tests for that (which were committed later) but there's nothing targeted for this.</div><div><br></div><div>-- Lang.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2020 at 12:29 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Does this have test coverage?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 11, 2020 at 8:05 PM Lang Hames via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
Author: Lang Hames<br>
Date: 2020-03-11T20:04:54-07:00<br>
New Revision: b19801640bf621a596187d819afb57514713d1e7<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/b19801640bf621a596187d819afb57514713d1e7" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/b19801640bf621a596187d819afb57514713d1e7</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/b19801640bf621a596187d819afb57514713d1e7.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/b19801640bf621a596187d819afb57514713d1e7.diff</a><br>
<br>
LOG: [ORC] Fix an overly aggressive assert.<br>
<br>
It is ok to add dependencies on symbols that are ready, they should just be<br>
skipped.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/lib/ExecutionEngine/Orc/Core.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp<br>
index ef4ab1e68c02..49b7395843a5 100644<br>
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp<br>
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp<br>
@@ -1001,16 +1001,18 @@ void JITDylib::addDependencies(const SymbolStringPtr &Name,<br>
       // Check the sym entry for the dependency.<br>
       auto OtherSymI = OtherJITDylib.Symbols.find(OtherSymbol);<br>
<br>
-#ifndef NDEBUG<br>
       // Assert that this symbol exists and has not reached the ready state<br>
       // already.<br>
       assert(OtherSymI != OtherJITDylib.Symbols.end() &&<br>
-             (OtherSymI->second.getState() < SymbolState::Ready &&<br>
-              "Dependency on emitted/ready symbol"));<br>
-#endif<br>
+             "Dependency on unknown symbol");<br>
<br>
       auto &OtherSymEntry = OtherSymI->second;<br>
<br>
+      // If the other symbol is already in the Ready state then there's no<br>
+      // dependency to add.<br>
+      if (OtherSymEntry.getState() == SymbolState::Ready)<br>
+        continue;<br>
+<br>
       // If the dependency is in an error state then note this and continue,<br>
       // we will move this symbol to the error state below.<br>
       if (OtherSymEntry.getFlags().hasError()) {<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>