Avoid using getDataLayout, deprecated in LLVM 3.7

This commit is contained in:
Seo Sanghyeon 2015-10-13 15:11:59 +09:00
parent 81b3b27cf5
commit 22dc408217

View File

@ -335,8 +335,7 @@ LLVMRustSetDataLayoutFromTargetMachine(LLVMModuleRef Module,
LLVMTargetMachineRef TMR) {
TargetMachine *Target = unwrap(TMR);
#if LLVM_VERSION_MINOR >= 7
if (const DataLayout *DL = Target->getDataLayout())
unwrap(Module)->setDataLayout(*DL);
unwrap(Module)->setDataLayout(Target->createDataLayout());
#elif LLVM_VERSION_MINOR >= 6
if (const DataLayout *DL = Target->getSubtargetImpl()->getDataLayout())
unwrap(Module)->setDataLayout(DL);