Skip to content

Commit bf01bcb

Browse files
vext01alexcrichton
authored andcommitted
Conditionally compile in only the extra argument.
1 parent a43a7a0 commit bf01bcb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/rustllvm/RustWrapper.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -705,17 +705,14 @@ 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
714708
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
715709
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
716710
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
717-
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
711+
InitExpr, unwrapDIPtr<MDNode>(Decl),
712+
#if LLVM_VERSION_GE(8, 0)
713+
/* templateParams */ nullptr,
718714
#endif
715+
AlignInBits);
719716

720717
InitVal->setMetadata("dbg", VarExpr);
721718

0 commit comments

Comments
 (0)