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/Chapter2/KaleidoscopeJIT.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | 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))), | ||||
OptimizeLayer(ES, CompileLayer, optimizeModule), | OptimizeLayer(ES, CompileLayer, optimizeModule), | ||||
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()))); | ||||
} | } | ||||
const DataLayout &getDataLayout() const { return DL; } | const DataLayout &getDataLayout() const { return DL; } | ||||
LLVMContext &getContext() { return *Ctx.getContext(); } | LLVMContext &getContext() { return *Ctx.getContext(); } | ||||
static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() { | static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() { | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |