summaryrefslogtreecommitdiffstats
path: root/llvm/examples
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-05-04 23:30:01 +0000
committerLang Hames <lhames@gmail.com>2015-05-04 23:30:01 +0000
commitac31a1f141c0daf31419c6d3c2502abda79d3d77 (patch)
treec1ef503be3b25b4bf42b22cb4f142bc1587732cd /llvm/examples
parent9dad227b85635f4f76b6afd12876ef21e16c5b35 (diff)
downloadbcm5719-llvm-ac31a1f141c0daf31419c6d3c2502abda79d3d77.tar.gz
bcm5719-llvm-ac31a1f141c0daf31419c6d3c2502abda79d3d77.zip
[Orc] Revert r236465 - It broke the Windows bots.
Looks like the usual missing explicit move-constructor issue with MSVC. I should have a fix shortly. llvm-svn: 236472
Diffstat (limited to 'llvm/examples')
-rw-r--r--llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp b/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp
index 93de33353da..b5822921b40 100644
--- a/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Orc/fully_lazy/toy.cpp
@@ -1214,11 +1214,11 @@ public:
void removeModule(ModuleHandleT H) { LazyEmitLayer.removeModuleSet(H); }
JITSymbol findSymbol(const std::string &Name) {
- return LazyEmitLayer.findSymbol(Name, false);
+ return LazyEmitLayer.findSymbol(Name, true);
}
JITSymbol findSymbolIn(ModuleHandleT H, const std::string &Name) {
- return LazyEmitLayer.findSymbolIn(H, Name, false);
+ return LazyEmitLayer.findSymbolIn(H, Name, true);
}
JITSymbol findUnmangledSymbol(const std::string &Name) {
@@ -1276,7 +1276,7 @@ private:
makeStub(*F, *FunctionBodyPointer);
// Step 4) Add the module containing the stub to the JIT.
- auto StubH = addModule(C.takeM());
+ auto H = addModule(C.takeM());
// Step 5) Set the compile and update actions.
//
@@ -1289,20 +1289,14 @@ private:
// The update action will update FunctionBodyPointer to point at the newly
// compiled function.
std::shared_ptr<FunctionAST> Fn = std::move(FnAST);
- CallbackInfo.setCompileAction([this, Fn, BodyPtrName, StubH]() {
+ CallbackInfo.setCompileAction([this, Fn]() {
auto H = addModule(IRGen(Session, *Fn));
- auto BodySym = findUnmangledSymbolIn(H, Fn->Proto->Name);
- auto BodyPtrSym = findUnmangledSymbolIn(StubH, BodyPtrName);
- assert(BodySym && "Missing function body.");
- assert(BodyPtrSym && "Missing function pointer.");
- auto BodyAddr = BodySym.getAddress();
- auto BodyPtr = reinterpret_cast<void*>(
- static_cast<uintptr_t>(BodyPtrSym.getAddress()));
- memcpy(BodyPtr, &BodyAddr, sizeof(uintptr_t));
- return BodyAddr;
+ return findUnmangledSymbolIn(H, Fn->Proto->Name).getAddress();
});
+ CallbackInfo.setUpdateAction(
+ getLocalFPUpdater(LazyEmitLayer, H, mangle(BodyPtrName)));
- return StubH;
+ return H;
}
SessionContext &Session;
OpenPOWER on IntegriCloud