]> git.lizzy.rs Git - rust.git/commitdiff
Fix builds with LLVM < 3.6
authorBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 15 Aug 2014 14:36:05 +0000 (16:36 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Fri, 15 Aug 2014 14:36:05 +0000 (16:36 +0200)
src/rustllvm/RustWrapper.cpp

index 8051235da20aa8000b02a499db4efac949505662..cdd36d7f458a41db6bf7bdabe51b0dde94d2b8e9 100644 (file)
@@ -282,7 +282,11 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateSubroutineType(
     LLVMValueRef ParameterTypes) {
     return wrap(Builder->createSubroutineType(
         unwrapDI<DIFile>(File),
+#if LLVM_VERSION_MINOR >= 6
         unwrapDI<DITypeArray>(ParameterTypes)));
+#else
+        unwrapDI<DIArray>(ParameterTypes)));
+#endif
 }
 
 extern "C" LLVMValueRef LLVMDIBuilderCreateFunction(
@@ -634,7 +638,11 @@ extern "C" void LLVMDICompositeTypeSetTypeArray(
     LLVMValueRef CompositeType,
     LLVMValueRef TypeArray)
 {
+#if LLVM_VERSION_MINOR >= 6
     unwrapDI<DICompositeType>(CompositeType).setArrays(unwrapDI<DIArray>(TypeArray));
+#else
+    unwrapDI<DICompositeType>(CompositeType).setTypeArray(unwrapDI<DIArray>(TypeArray));
+#endif
 }
 
 extern "C" char *LLVMTypeToString(LLVMTypeRef Type) {