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

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