Skip to content

Commit 0383dfa

Browse files
committed
Conditionally compile in only the extra argument.
1 parent e8bce2b commit 0383dfa

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/rustllvm/RustWrapper.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -793,17 +793,14 @@ 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
802796
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
803797
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
804798
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
805-
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
799+
InitExpr, unwrapDIPtr<MDNode>(Decl),
800+
#if LLVM_VERSION_GE(8, 0)
801+
/* templateParams */ nullptr,
806802
#endif
803+
AlignInBits);
807804

808805
InitVal->setMetadata("dbg", VarExpr);
809806

0 commit comments

Comments
 (0)