Conditionally compile in only the extra argument.

This commit is contained in:
Edd Barrett 2018-11-07 12:34:43 +00:00 committed by Alex Crichton
parent a43a7a0778
commit bf01bcb451

View File

@ -705,17 +705,14 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
FPVal->getValueAPF().bitcastToAPInt().getZExtValue());
}
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
InitExpr, unwrapDIPtr<MDNode>(Decl),
#if LLVM_VERSION_GE(8, 0)
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
InitExpr, unwrapDIPtr<MDNode>(Decl), nullptr, AlignInBits);
#else
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
/* templateParams */ nullptr,
#endif
AlignInBits);
InitVal->setMetadata("dbg", VarExpr);