Skip to content

Commit 22dc408

Browse files
committed
Avoid using getDataLayout, deprecated in LLVM 3.7
1 parent 81b3b27 commit 22dc408

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/rustllvm/PassWrapper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ LLVMRustSetDataLayoutFromTargetMachine(LLVMModuleRef Module,
335335
LLVMTargetMachineRef TMR) {
336336
TargetMachine *Target = unwrap(TMR);
337337
#if LLVM_VERSION_MINOR >= 7
338-
if (const DataLayout *DL = Target->getDataLayout())
339-
unwrap(Module)->setDataLayout(*DL);
338+
unwrap(Module)->setDataLayout(Target->createDataLayout());
340339
#elif LLVM_VERSION_MINOR >= 6
341340
if (const DataLayout *DL = Target->getSubtargetImpl()->getDataLayout())
342341
unwrap(Module)->setDataLayout(DL);

0 commit comments

Comments
 (0)