about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorEdd Barrett <vext01@gmail.com>2018-11-07 12:34:43 +0000
committerAlex Crichton <alex@alexcrichton.com>2018-11-25 20:27:18 -0800
commitbf01bcb451d20d770091acb5cde4a024d91a0740 (patch)
treed652c446ae79a37bf3cecbce50e769f1eacc7fba /src/rustllvm/RustWrapper.cpp
parenta43a7a07785fdaca7c04ae2ba2f29512dcca58f4 (diff)
downloadrust-bf01bcb451d20d770091acb5cde4a024d91a0740.tar.gz
rust-bf01bcb451d20d770091acb5cde4a024d91a0740.zip
Conditionally compile in only the extra argument.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 8f7db9e768b..b6e07942f86 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -705,17 +705,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);