Skip to content

Commit

Permalink
Fix builds with LLVM < 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdash committed Aug 15, 2014
1 parent 1d12b6d commit f1f67b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/rustllvm/RustWrapper.cpp
Expand Up @@ -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(
Expand Down Expand Up @@ -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) {
Expand Down

5 comments on commit f1f67b2

@bors
Copy link
Contributor

@bors bors commented on f1f67b2 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from thestinger
at dotdash@f1f67b2

@bors
Copy link
Contributor

@bors bors commented on f1f67b2 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging dotdash/rust/fix_llvm_before_36 = f1f67b2 into auto

@bors
Copy link
Contributor

@bors bors commented on f1f67b2 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotdash/rust/fix_llvm_before_36 = f1f67b2 merged ok, testing candidate = ec9476c

@bors
Copy link
Contributor

@bors bors commented on f1f67b2 Aug 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = ec9476c

Please sign in to comment.