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:05:54 +0000
committerAlex Crichton <alex@alexcrichton.com>2018-11-25 20:27:18 -0800
commita43a7a07785fdaca7c04ae2ba2f29512dcca58f4 (patch)
tree568d45b297cf9e5540e81bc50356e4749e2925f4 /src/rustllvm/RustWrapper.cpp
parentae5b350d7757a70e53219bbb5e32ae149ad063e0 (diff)
downloadrust-a43a7a07785fdaca7c04ae2ba2f29512dcca58f4.tar.gz
rust-a43a7a07785fdaca7c04ae2ba2f29512dcca58f4.zip
Make Rustc build with LLVM trunk.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index f423503e19f..8f7db9e768b 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -705,10 +705,17 @@ 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);
+#endif
 
   InitVal->setMetadata("dbg", VarExpr);