Avoid using getDataLayout, deprecated in LLVM 3.7
This commit is contained in:
parent
81b3b27cf5
commit
22dc408217
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue