summaryrefslogtreecommitdiff
path: root/include/llvm/ExecutionEngine
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:10 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:10 +0000
commit93c91e39b29142dec1d03a30df9f6e757f56c193 (patch)
tree33a9b014a327e64450b3c9ed46d8c5bdb78ad345 /include/llvm/ExecutionEngine
parentca089b24d48ef6fa8da2d0bb8c25bb802c4a95c0 (diff)
Notes
Diffstat (limited to 'include/llvm/ExecutionEngine')
-rw-r--r--include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h24
-rw-r--r--include/llvm/ExecutionEngine/RTDyldMemoryManager.h5
2 files changed, 14 insertions, 15 deletions
diff --git a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
index c1acca386820..27b5457fc8ff 100644
--- a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
+++ b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
@@ -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,21 @@ 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;
- else
- return true;
+ if (auto Err = LMResources->StubsMgr->updatePointer(CalledFnName,
+ FnBodyAddr))
+ return Err;
+ return Error::success();
}
}
- return false;
+ return make_error<JITSymbolNotFound>(FuncName);
}
private:
@@ -363,11 +364,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
diff --git a/include/llvm/ExecutionEngine/RTDyldMemoryManager.h b/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
index a9778514b9f1..0c1862c5c3ea 100644
--- a/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
+++ b/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
@@ -135,12 +135,13 @@ public:
virtual void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true);
-private:
+protected:
struct EHFrame {
uint8_t *Addr;
size_t Size;
};
- std::vector<EHFrame> EHFrames;
+ typedef std::vector<EHFrame> EHFrameInfos;
+ EHFrameInfos EHFrames;
};
// Create wrappers for C Binding types (see CBindingWrapping.h).