_REALLY_ fix the float constant problem

llvm-svn: 4609
This commit is contained in:
Chris Lattner 2002-11-07 22:12:53 +00:00
parent 18f46ff428
commit 3de4680d56

View File

@ -778,11 +778,12 @@ void CWriter::printFunction(Function *F) {
Out << " const ConstantDoubleTy FloatConstant" << FPCounter++
<< " = 0x" << std::hex << *(unsigned long long*)&Val << std::dec
<< "; /* " << Val << " */\n";
else if (FPC->getType() == Type::FloatTy)
else if (FPC->getType() == Type::FloatTy) {
float fVal = Val;
Out << " const ConstantFloatTy FloatConstant" << FPCounter++
<< " = 0x" << std::hex << *(unsigned*)&Val << std::dec
<< " = 0x" << std::hex << *(unsigned*)&fVal << std::dec
<< "; /* " << Val << " */\n";
else
} else
assert(0 && "Unknown float type!");
}