- OwningPtr<ExecutionEngine> JIT(ExecutionEngine::createJIT(
- MP,
- &Error,
- MemMgr,
- CodeGenOpt::Default,
- false)); // This last argument enables the fix.
+ OwningPtr<ExecutionEngine> JIT(EngineBuilder(MP)
+ .setEnginePreference(EngineBuilder::JITONLY)
+ .setErrorStr(&Error)
+ .setJITMemoryManager(MemMgr)
+ // The next line enables the fix:
+ .setAllocateGVsWithCode(false)
+ .create());