summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2015-10-24 18:42:23 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2015-10-24 18:42:23 +0900
commitb285f9202590050a7b480a99a074673630b11f4f (patch)
treea7f6f8696fc7dbc51a42b612385e29354ce94c83 /src/rustllvm/RustWrapper.cpp
parent2e86485f7b9cc7f4dd702b4cd1c767e12d6d91eb (diff)
downloadrust-b285f9202590050a7b480a99a074673630b11f4f.tar.gz
rust-b285f9202590050a7b480a99a074673630b11f4f.zip
rustllvm: Update to LLVM trunk
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 9ce34c40730..5a9c096e5f5 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -320,7 +320,9 @@ extern "C" LLVMMetadataRef LLVMDIBuilderCreateSubroutineType(
     LLVMMetadataRef File,
     LLVMMetadataRef ParameterTypes) {
     return wrap(Builder->createSubroutineType(
+#if LLVM_VERSION_MINOR <= 7
         unwrapDI<DIFile>(File),
+#endif
 #if LLVM_VERSION_MINOR >= 7
         DITypeRefArray(unwrap<MDTuple>(ParameterTypes))));
 #elif LLVM_VERSION_MINOR >= 6
@@ -502,11 +504,27 @@ extern "C" LLVMMetadataRef LLVMDIBuilderCreateVariable(
         ));
     }
 #endif
+#if LLVM_VERSION_MINOR >= 8
+    if (Tag == 0x100) { // DW_TAG_auto_variable
+        return wrap(Builder->createAutoVariable(
+            unwrapDI<DIDescriptor>(Scope), Name,
+            unwrapDI<DIFile>(File),
+            LineNo,
+            unwrapDI<DIType>(Ty), AlwaysPreserve, Flags));
+    } else {
+        return wrap(Builder->createParameterVariable(
+            unwrapDI<DIDescriptor>(Scope), Name, ArgNo,
+            unwrapDI<DIFile>(File),
+            LineNo,
+            unwrapDI<DIType>(Ty), AlwaysPreserve, Flags));
+    }
+#else
     return wrap(Builder->createLocalVariable(Tag,
         unwrapDI<DIDescriptor>(Scope), Name,
         unwrapDI<DIFile>(File),
         LineNo,
         unwrapDI<DIType>(Ty), AlwaysPreserve, Flags, ArgNo));
+#endif
 }
 
 extern "C" LLVMMetadataRef LLVMDIBuilderCreateArrayType(