<div dir="ltr">Good catch. Fixed in r308203. :)<div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 17, 2017 at 9:27 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Thu, Jul 13, 2017 at 1:45 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: lhames<br>
Date: Thu Jul 13 13:44:46 2017<br>
New Revision: 307952<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=307952&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=307952&view=rev</a><br>
Log:<br>
[Orc] Fix some Error-related fixmes in CompileOnDemandLayer now that the layer<br>
interface has been errorized.<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/<wbr>ExecutionEngine/Orc/<wbr>CompileOnDemandLayer.h<br>
<br>
Modified: llvm/trunk/include/llvm/<wbr>ExecutionEngine/Orc/<wbr>CompileOnDemandLayer.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h?rev=307952&r1=307951&r2=307952&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/include/<wbr>llvm/ExecutionEngine/Orc/<wbr>CompileOnDemandLayer.h?rev=<wbr>307952&r1=307951&r2=307952&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/include/llvm/<wbr>ExecutionEngine/Orc/<wbr>CompileOnDemandLayer.h (original)<br>
+++ llvm/trunk/include/llvm/<wbr>ExecutionEngine/Orc/<wbr>CompileOnDemandLayer.h Thu Jul 13 13:44:46 2017<br>
@@ -22,6 +22,7 @@<br>
#include "llvm/ExecutionEngine/<wbr>JITSymbol.h"<br>
#include "llvm/ExecutionEngine/Orc/<wbr>IndirectionUtils.h"<br>
#include "llvm/ExecutionEngine/Orc/<wbr>LambdaResolver.h"<br>
+#include "llvm/ExecutionEngine/Orc/<wbr>OrcError.h"<br>
#include "llvm/ExecutionEngine/<wbr>RuntimeDyld.h"<br>
#include "llvm/IR/Attributes.h"<br>
#include "llvm/IR/Constant.h"<br>
@@ -289,21 +290,22 @@ public:<br>
// FIXME: We should track and free associated resources (unused compile<br>
// callbacks, uncompiled IR, and no-longer-needed/reachable function<br>
// implementations).<br>
- // FIXME: Return Error once the JIT APIs are Errorized.<br>
- bool updatePointer(std::string FuncName, JITTargetAddress FnBodyAddr) {<br>
+ Error updatePointer(std::string FuncName, JITTargetAddress FnBodyAddr) {<br>
//Find out which logical dylib contains our symbol<br>
auto LDI = LogicalDylibs.begin();<br>
for (auto LDE = LogicalDylibs.end(); LDI != LDE; ++LDI) {<br>
- if (auto LMResources = LDI-><wbr>getLogicalModuleResourcesForSy<wbr>mbol(FuncName, false)) {<br>
+ if (auto LMResources =<br>
+ LDI-><wbr>getLogicalModuleResourcesForSy<wbr>mbol(FuncName, false)) {<br>
Module &SrcM = LMResources->SourceModule-><wbr>getResource();<br>
std::string CalledFnName = mangle(FuncName, SrcM.getDataLayout());<br>
- if (auto EC = LMResources->StubsMgr-><wbr>updatePointer(CalledFnName, FnBodyAddr))<br>
- return false;<br>
+ if (auto Err = LMResources->StubsMgr-><wbr>updatePointer(CalledFnName,<br>
+ FnBodyAddr))<br>
+ return Err;<br>
else<br></blockquote></div></div><div><br>Remove else after return?<br> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- return true;<br>
+ return Error::success();<br>
}<br>
}<br>
- return false;<br>
+ return make_error<JITSymbolNotFound>(<wbr>FuncName);<br>
}<br>
<br>
private:<br>
@@ -363,11 +365,8 @@ private:<br>
});<br>
}<br>
<br>
- auto EC = LD.StubsMgr->createStubs(<wbr>StubInits);<br>
- (void)EC;<br>
- // FIXME: This should be propagated back to the user. Stub creation may<br>
- // fail for remote JITs.<br>
- assert(!EC && "Error generating stubs");<br>
+ if (auto Err = LD.StubsMgr->createStubs(<wbr>StubInits))<br>
+ return Err;<br>
}<br>
<br>
// If this module doesn't contain any globals, aliases, or module flags then<br>
<br>
<br>
______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></span></div></div>
</blockquote></div><br></div>