summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lli/OrcLazyJIT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lli/OrcLazyJIT.cpp')
-rw-r--r--contrib/llvm/tools/lli/OrcLazyJIT.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/llvm/tools/lli/OrcLazyJIT.cpp b/contrib/llvm/tools/lli/OrcLazyJIT.cpp
index bda5d6d..afccfa6 100644
--- a/contrib/llvm/tools/lli/OrcLazyJIT.cpp
+++ b/contrib/llvm/tools/lli/OrcLazyJIT.cpp
@@ -108,6 +108,9 @@ OrcLazyJIT::TransformFtor OrcLazyJIT::createDebugDumper() {
llvm_unreachable("Unknown DumpKind");
}
+// Defined in lli.cpp.
+CodeGenOpt::Level getOptLevel();
+
int llvm::runOrcLazyJIT(std::unique_ptr<Module> M, int ArgC, char* ArgV[]) {
// Add the program's symbols into the JIT's search space.
if (sys::DynamicLibrary::LoadLibraryPermanently(nullptr)) {
@@ -117,7 +120,9 @@ int llvm::runOrcLazyJIT(std::unique_ptr<Module> M, int ArgC, char* ArgV[]) {
// Grab a target machine and try to build a factory function for the
// target-specific Orc callback manager.
- auto TM = std::unique_ptr<TargetMachine>(EngineBuilder().selectTarget());
+ EngineBuilder EB;
+ EB.setOptLevel(getOptLevel());
+ auto TM = std::unique_ptr<TargetMachine>(EB.selectTarget());
auto &Context = getGlobalContext();
auto CallbackMgrBuilder =
OrcLazyJIT::createCallbackManagerBuilder(Triple(TM->getTargetTriple()));
OpenPOWER on IntegriCloud