mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-27 23:13:27 +00:00
Make temporaries explicit to avoid premature
destruction of compiler-created ones. llvm-svn: 42383
This commit is contained in:
parent
dee72e636e
commit
089d2e760f
@ -529,11 +529,14 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
if (Ty == Type::FloatTy || Ty == Type::DoubleTy) {
|
||||
Record.push_back(CFP->getValueAPF().convertToAPInt().getZExtValue());
|
||||
} else if (Ty == Type::X86_FP80Ty) {
|
||||
const uint64_t *p = CFP->getValueAPF().convertToAPInt().getRawData();
|
||||
// api needed to prevent premature destruction
|
||||
APInt api = CFP->getValueAPF().convertToAPInt();
|
||||
const uint64_t *p = api.getRawData();
|
||||
Record.push_back(p[0]);
|
||||
Record.push_back((uint16_t)p[1]);
|
||||
} else if (Ty == Type::FP128Ty) {
|
||||
const uint64_t *p = CFP->getValueAPF().convertToAPInt().getRawData();
|
||||
APInt api = CFP->getValueAPF().convertToAPInt();
|
||||
const uint64_t *p = api.getRawData();
|
||||
Record.push_back(p[0]);
|
||||
Record.push_back(p[1]);
|
||||
} else if (Ty == Type::PPC_FP128Ty) {
|
||||
|
@ -876,7 +876,9 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
|
||||
return;
|
||||
} else if (CFP->getType() == Type::X86_FP80Ty) {
|
||||
// all long double variants are printed as hex
|
||||
const uint64_t *p = CFP->getValueAPF().convertToAPInt().getRawData();
|
||||
// api needed to prevent premature destruction
|
||||
APInt api = CFP->getValueAPF().convertToAPInt();
|
||||
const uint64_t *p = api.getRawData();
|
||||
if (TD->isBigEndian()) {
|
||||
O << TAI->getData16bitsDirective() << uint16_t(p[0] >> 48)
|
||||
<< "\t" << TAI->getCommentString()
|
||||
|
@ -1729,7 +1729,9 @@ void CWriter::printFloatingPointConstants(Function &F) {
|
||||
<< " = 0x" << std::hex << i << std::dec
|
||||
<< "U; /* " << Val << " */\n";
|
||||
} else if (FPC->getType() == Type::X86_FP80Ty) {
|
||||
const uint64_t *p = FPC->getValueAPF().convertToAPInt().getRawData();
|
||||
// api needed to prevent premature destruction
|
||||
APInt api = FPC->getValueAPF().convertToAPInt();
|
||||
const uint64_t *p = api.getRawData();
|
||||
Out << "static const ConstantFP80Ty FPConstant" << FPCounter++
|
||||
<< " = { 0x" << std::hex
|
||||
<< ((uint16_t)p[1] | (p[0] & 0xffffffffffffLL)<<16)
|
||||
|
@ -521,7 +521,9 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
|
||||
Out << 'L';
|
||||
else
|
||||
assert(0 && "Unsupported floating point type");
|
||||
const uint64_t* p = CFP->getValueAPF().convertToAPInt().getRawData();
|
||||
// api needed to prevent premature destruction
|
||||
APInt api = CFP->getValueAPF().convertToAPInt();
|
||||
const uint64_t* p = api.getRawData();
|
||||
uint64_t word = *p;
|
||||
int shiftcount=60;
|
||||
int width = CFP->getValueAPF().convertToAPInt().getBitWidth();
|
||||
|
Loading…
x
Reference in New Issue
Block a user