Skip to content

Commit a43a7a0

Browse files
vext01alexcrichton
authored andcommitted
Make Rustc build with LLVM trunk.
1 parent ae5b350 commit a43a7a0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustllvm/RustWrapper.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -705,10 +705,17 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
705705
FPVal->getValueAPF().bitcastToAPInt().getZExtValue());
706706
}
707707

708+
#if LLVM_VERSION_GE(8, 0)
709+
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
710+
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
711+
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
712+
InitExpr, unwrapDIPtr<MDNode>(Decl), nullptr, AlignInBits);
713+
#else
708714
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
709715
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
710716
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
711717
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
718+
#endif
712719

713720
InitVal->setMetadata("dbg", VarExpr);
714721

0 commit comments

Comments
 (0)