From b4aca21422c0bb1ecd8c44ddb8f21c42d25ddf02 Mon Sep 17 00:00:00 2001 From: kai Date: Wed, 23 Jan 2013 18:22:45 +0100 Subject: [PATCH] More LLVM 3.3 changes. There is ongoing rework on the AttributeSet class. Also the constructor of APFloat changed. --- gen/runtime.cpp | 28 ++++++++++++++-------------- gen/tollvm.cpp | 8 ++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/gen/runtime.cpp b/gen/runtime.cpp index 033a521c98..9f390c48cf 100644 --- a/gen/runtime.cpp +++ b/gen/runtime.cpp @@ -206,35 +206,35 @@ static void LLVM_D_BuildRuntimeModule() llvm::AttributeSet NoAttrs, Attr_NoAlias - = NoAttrs.addAttr(gIR->context(), 0, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoAlias))), + = NoAttrs.addAttribute(gIR->context(), 0, llvm::Attribute::NoAlias), Attr_NoUnwind - = NoAttrs.addAttr(gIR->context(), ~0U, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoUnwind))), + = NoAttrs.addAttribute(gIR->context(), ~0U, llvm::Attribute::NoUnwind), Attr_ReadOnly - = NoAttrs.addAttr(gIR->context(), ~0U, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::ReadOnly))), + = NoAttrs.addAttribute(gIR->context(), ~0U, llvm::Attribute::ReadOnly), Attr_ReadOnly_NoUnwind - = Attr_ReadOnly.addAttr(gIR->context(), ~0U, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoUnwind))), + = Attr_ReadOnly.addAttribute(gIR->context(), ~0U, llvm::Attribute::NoUnwind), Attr_ReadOnly_1_NoCapture - = Attr_ReadOnly.addAttr(gIR->context(), 1, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))), + = Attr_ReadOnly.addAttribute(gIR->context(), 1, llvm::Attribute::NoCapture), Attr_ReadOnly_1_3_NoCapture - = Attr_ReadOnly_1_NoCapture.addAttr(gIR->context(), 3, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))), + = Attr_ReadOnly_1_NoCapture.addAttribute(gIR->context(), 3, llvm::Attribute::NoCapture), Attr_ReadOnly_NoUnwind_1_NoCapture - = Attr_ReadOnly_1_NoCapture.addAttr(gIR->context(), ~0U, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoUnwind))), + = Attr_ReadOnly_1_NoCapture.addAttribute(gIR->context(), ~0U, llvm::Attribute::NoUnwind), Attr_ReadNone - = NoAttrs.addAttr(gIR->context(), ~0U, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::ReadNone))), + = NoAttrs.addAttribute(gIR->context(), ~0U, llvm::Attribute::ReadNone), Attr_1_NoCapture - = NoAttrs.addAttr(gIR->context(), 1, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))), + = NoAttrs.addAttribute(gIR->context(), 1, llvm::Attribute::NoCapture), Attr_NoAlias_1_NoCapture - = Attr_1_NoCapture.addAttr(gIR->context(), 0, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoAlias))), + = Attr_1_NoCapture.addAttribute(gIR->context(), 0, llvm::Attribute::NoAlias), #if DMDV1 Attr_NoAlias_3_NoCapture - = Attr_NoAlias.addAttr(gIR->context(), 3, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))), + = Attr_NoAlias.addAttribute(gIR->context(), 3, llvm::Attribute::NoCapture), #endif Attr_1_2_NoCapture - = Attr_1_NoCapture.addAttr(gIR->context(), 2, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))), + = Attr_1_NoCapture.addAttribute(gIR->context(), 2, llvm::Attribute::NoCapture), Attr_1_3_NoCapture - = Attr_1_NoCapture.addAttr(gIR->context(), 3, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))), + = Attr_1_NoCapture.addAttribute(gIR->context(), 3, llvm::Attribute::NoCapture), Attr_1_4_NoCapture - = Attr_1_NoCapture.addAttr(gIR->context(), 4, llvm::Attribute::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attribute::NoCapture))); + = Attr_1_NoCapture.addAttribute(gIR->context(), 4, llvm::Attribute::NoCapture); #elif LDC_LLVM_VER == 302 llvm::AttrListPtr NoAttrs, diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 12f1937ecf..bf9947d35a 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -675,12 +675,20 @@ LLConstant* DtoConstFP(Type* t, longdouble value) uint64_t bits[] = {0, 0}; bits[0] = *reinterpret_cast(&value); bits[1] = *reinterpret_cast(reinterpret_cast(&value) + 1); +#if LDC_LLVM_VER >= 303 + return LLConstantFP::get(gIR->context(), APFloat(APFloat::x87DoubleExtended, APInt(80, 2, bits))); +#else return LLConstantFP::get(gIR->context(), APFloat(APInt(80, 2, bits))); +#endif } else if(llty == LLType::getPPC_FP128Ty(gIR->context())) { uint64_t bits[] = {0, 0}; bits[0] = *reinterpret_cast(&value); bits[1] = *reinterpret_cast(reinterpret_cast(&value) + 1); +#if LDC_LLVM_VER >= 303 + return LLConstantFP::get(gIR->context(), APFloat(APFloat::PPCDoubleDouble, APInt(128, 2, bits))); +#else return LLConstantFP::get(gIR->context(), APFloat(APInt(128, 2, bits))); +#endif } else { assert(0 && "Unknown floating point type encountered"); }