[llvm] r307952 - [Orc] Fix some Error-related fixmes in CompileOnDemandLayer now that the layer
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 09:27:55 PDT 2017
On Thu, Jul 13, 2017 at 1:45 PM Lang Hames via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: lhames
> Date: Thu Jul 13 13:44:46 2017
> New Revision: 307952
>
> URL: http://llvm.org/viewvc/llvm-project?rev=307952&view=rev
> Log:
> [Orc] Fix some Error-related fixmes in CompileOnDemandLayer now that the
> layer
> interface has been errorized.
>
> Modified:
> llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
>
> Modified:
> llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h?rev=307952&r1=307951&r2=307952&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
> (original)
> +++ llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h Thu
> Jul 13 13:44:46 2017
> @@ -22,6 +22,7 @@
> #include "llvm/ExecutionEngine/JITSymbol.h"
> #include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
> #include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
> +#include "llvm/ExecutionEngine/Orc/OrcError.h"
> #include "llvm/ExecutionEngine/RuntimeDyld.h"
> #include "llvm/IR/Attributes.h"
> #include "llvm/IR/Constant.h"
> @@ -289,21 +290,22 @@ public:
> // FIXME: We should track and free associated resources (unused compile
> // callbacks, uncompiled IR, and no-longer-needed/reachable
> function
> // implementations).
> - // FIXME: Return Error once the JIT APIs are Errorized.
> - bool updatePointer(std::string FuncName, JITTargetAddress FnBodyAddr) {
> + Error updatePointer(std::string FuncName, JITTargetAddress FnBodyAddr) {
> //Find out which logical dylib contains our symbol
> auto LDI = LogicalDylibs.begin();
> for (auto LDE = LogicalDylibs.end(); LDI != LDE; ++LDI) {
> - if (auto LMResources =
> LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) {
> + if (auto LMResources =
> + LDI->getLogicalModuleResourcesForSymbol(FuncName, false)) {
> Module &SrcM = LMResources->SourceModule->getResource();
> std::string CalledFnName = mangle(FuncName, SrcM.getDataLayout());
> - if (auto EC = LMResources->StubsMgr->updatePointer(CalledFnName,
> FnBodyAddr))
> - return false;
> + if (auto Err = LMResources->StubsMgr->updatePointer(CalledFnName,
> + FnBodyAddr))
> + return Err;
> else
>
Remove else after return?
> - return true;
> + return Error::success();
> }
> }
> - return false;
> + return make_error<JITSymbolNotFound>(FuncName);
> }
>
> private:
> @@ -363,11 +365,8 @@ private:
> });
> }
>
> - auto EC = LD.StubsMgr->createStubs(StubInits);
> - (void)EC;
> - // FIXME: This should be propagated back to the user. Stub creation
> may
> - // fail for remote JITs.
> - assert(!EC && "Error generating stubs");
> + if (auto Err = LD.StubsMgr->createStubs(StubInits))
> + return Err;
> }
>
> // If this module doesn't contain any globals, aliases, or module
> flags then
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170717/31dcc9bf/attachment.html>
More information about the llvm-commits
mailing list