Skip to content

Commit e8bce2b

Browse files
committed
Make Rustc build with LLVM trunk.
1 parent ddd4b19 commit e8bce2b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustllvm/RustWrapper.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,17 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
793793
FPVal->getValueAPF().bitcastToAPInt().getZExtValue());
794794
}
795795

796+
#if LLVM_VERSION_GE(8, 0)
797+
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
798+
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
799+
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
800+
InitExpr, unwrapDIPtr<MDNode>(Decl), nullptr, AlignInBits);
801+
#else
796802
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
797803
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
798804
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
799805
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
806+
#endif
800807

801808
InitVal->setMetadata("dbg", VarExpr);
802809

0 commit comments

Comments
 (0)