new llvm::GlobalVariable(module,
stringConstant->getType(),
true,
- llvm::GlobalValue::LinkerPrivateLinkage,
+ llvm::GlobalValue::PrivateLinkage,
stringConstant,
"");
}
new llvm::GlobalVariable(module,
stringConstant->getType(),
true,
- llvm::GlobalValue::LinkerPrivateLinkage,
+ llvm::GlobalValue::PrivateLinkage,
stringConstant,
"");
}
// Build engine with JIT
llvm::EngineBuilder factory(module);
factory.setEngineKind(llvm::EngineKind::JIT);
- factory.setAllocateGVsWithCode(false);
factory.setTargetOptions(Opts);
factory.setMCJITMemoryManager(MemMgr);
- factory.setUseMCJIT(true);
llvm::ExecutionEngine *executionEngine = factory.create();
{
// Set up the optimizer pipeline.
// Start with registering info about how the
// target lays out data structures.
- fpm.add(new llvm::DataLayout(*executionEngine->getDataLayout()));
+ module->setDataLayout(executionEngine->getDataLayout());
+ fpm.add(new llvm::DataLayoutPass(module));
// Optimizations turned on
#ifdef ADD_OPT_PASSES