aboutsummaryrefslogtreecommitdiff
path: root/examples/Kaleidoscope/include/KaleidoscopeJIT.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Kaleidoscope/include/KaleidoscopeJIT.h')
-rw-r--r--examples/Kaleidoscope/include/KaleidoscopeJIT.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/Kaleidoscope/include/KaleidoscopeJIT.h b/examples/Kaleidoscope/include/KaleidoscopeJIT.h
index fe73d717976d..215ce03af99b 100644
--- a/examples/Kaleidoscope/include/KaleidoscopeJIT.h
+++ b/examples/Kaleidoscope/include/KaleidoscopeJIT.h
@@ -45,6 +45,7 @@ public:
KaleidoscopeJIT()
: TM(EngineBuilder().selectTarget()), DL(TM->createDataLayout()),
+ ObjectLayer([]() { return std::make_shared<SectionMemoryManager>(); }),
CompileLayer(ObjectLayer, SimpleCompiler(*TM)) {
llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr);
}
@@ -62,9 +63,8 @@ public:
return JITSymbol(nullptr);
},
[](const std::string &S) { return nullptr; });
- auto H = CompileLayer.addModule(std::move(M),
- make_unique<SectionMemoryManager>(),
- std::move(Resolver));
+ auto H = cantFail(CompileLayer.addModule(std::move(M),
+ std::move(Resolver)));
ModuleHandles.push_back(H);
return H;
@@ -72,7 +72,7 @@ public:
void removeModule(ModuleHandleT H) {
ModuleHandles.erase(find(ModuleHandles, H));
- CompileLayer.removeModule(H);
+ cantFail(CompileLayer.removeModule(H));
}
JITSymbol findSymbol(const std::string Name) {
@@ -115,7 +115,7 @@ private:
return JITSymbol(SymAddr, JITSymbolFlags::Exported);
#ifdef LLVM_ON_WIN32
- // For Windows retry without "_" at begining, as RTDyldMemoryManager uses
+ // For Windows retry without "_" at beginning, as RTDyldMemoryManager uses
// GetProcAddress and standard libraries like msvcrt.dll use names
// with and without "_" (for example "_itoa" but "sin").
if (Name.length() > 2 && Name[0] == '_')