Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL) | KaleidoscopeJIT(JITTargetMachineBuilder JTMB, DataLayout DL) | ||||
: ObjectLayer(ES, | : ObjectLayer(ES, | ||||
[]() { return std::make_unique<SectionMemoryManager>(); }), | []() { return std::make_unique<SectionMemoryManager>(); }), | ||||
CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), | CompileLayer(ES, ObjectLayer, ConcurrentIRCompiler(std::move(JTMB))), | ||||
DL(std::move(DL)), Mangle(ES, this->DL), | DL(std::move(DL)), Mangle(ES, this->DL), | ||||
Ctx(std::make_unique<LLVMContext>()) { | Ctx(std::make_unique<LLVMContext>()) { | ||||
ES.getMainJITDylib().addGenerator( | ES.getMainJITDylib().addGenerator( | ||||
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( | llvm_cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( | ||||
DL.getGlobalPrefix()))); | DL.getGlobalPrefix()))); | ||||
} | } | ||||
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() { | static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() { | ||||
auto JTMB = JITTargetMachineBuilder::detectHost(); | auto JTMB = JITTargetMachineBuilder::detectHost(); | ||||
if (!JTMB) | if (!JTMB) | ||||
return JTMB.takeError(); | return JTMB.takeError(); | ||||
Show All 26 Lines |