More LLVM 3.3 changes.

There is ongoing rework on the AttributeSet class. Also the constructor
of APFloat changed.
This commit is contained in:
kai 2013-01-23 18:22:45 +01:00
parent 4005410794
commit b4aca21422
2 changed files with 22 additions and 14 deletions

View file

@ -206,35 +206,35 @@ static void LLVM_D_BuildRuntimeModule()
llvm::AttributeSet llvm::AttributeSet
NoAttrs, NoAttrs,
Attr_NoAlias 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 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 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_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_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_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_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 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 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_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 #if DMDV1
Attr_NoAlias_3_NoCapture 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 #endif
Attr_1_2_NoCapture 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_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_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 #elif LDC_LLVM_VER == 302
llvm::AttrListPtr llvm::AttrListPtr
NoAttrs, NoAttrs,

View file

@ -675,12 +675,20 @@ LLConstant* DtoConstFP(Type* t, longdouble value)
uint64_t bits[] = {0, 0}; uint64_t bits[] = {0, 0};
bits[0] = *reinterpret_cast<uint64_t*>(&value); bits[0] = *reinterpret_cast<uint64_t*>(&value);
bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&value) + 1); bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&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))); return LLConstantFP::get(gIR->context(), APFloat(APInt(80, 2, bits)));
#endif
} else if(llty == LLType::getPPC_FP128Ty(gIR->context())) { } else if(llty == LLType::getPPC_FP128Ty(gIR->context())) {
uint64_t bits[] = {0, 0}; uint64_t bits[] = {0, 0};
bits[0] = *reinterpret_cast<uint64_t*>(&value); bits[0] = *reinterpret_cast<uint64_t*>(&value);
bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&value) + 1); bits[1] = *reinterpret_cast<uint16_t*>(reinterpret_cast<uint64_t*>(&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))); return LLConstantFP::get(gIR->context(), APFloat(APInt(128, 2, bits)));
#endif
} else { } else {
assert(0 && "Unknown floating point type encountered"); assert(0 && "Unknown floating point type encountered");
} }