From c0284bac2b9124ea7f6a2363bc57321e904782af Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 26 Jan 2013 17:34:08 +0100 Subject: [PATCH] 2nd attempt on the latest LLVM 3.3 changes. The previous commit only worked on Windows. --- gen/functions.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index 238b0df5..b8d70f0c 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -613,11 +613,12 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati #endif for (size_t i = 0; i < oldAttrs.getNumSlots(); ++i) { #if LDC_LLVM_VER >= 303 - llvm::AttributeWithIndex curr = llvm::AttributeWithIndex::get(oldAttrs.getSlotIndex(i), + const unsigned Index = oldAttrs.getSlotIndex(i); + llvm::AttrBuilder &builder = llvm::AttrBuilder(oldAttrs.getSlotAttributes(i), Index).addAttribute(llvm::Attribute::None); + llvm::AttributeWithIndex curr = llvm::AttributeWithIndex::get(Index, llvm::Attribute::get( gIR->context(), - llvm::AttrBuilder(oldAttrs.getSlotAttributes(i), - oldAttrs.getSlotIndex(i)))); + builder)); #else llvm::AttributeWithIndex curr = oldAttrs.getSlot(i); #endif