Skip to content

Commit

Permalink
Conditionally compile in only the extra argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
vext01 authored and alexcrichton committed Nov 9, 2018
1 parent fbcad04 commit 4d4a4e7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,17 +793,14 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
FPVal->getValueAPF().bitcastToAPInt().getZExtValue());
}

#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);
InitExpr, unwrapDIPtr<MDNode>(Decl),
#if LLVM_VERSION_GE(8, 0)
/* templateParams */ nullptr,
#endif
AlignInBits);

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

Expand Down

0 comments on commit 4d4a4e7

Please sign in to comment.