Changes in directory llvm/lib/VMCore:
ConstantFolding.cpp updated: 1.134 -> 1.135 --- Log message: Fix Transforms/ConstProp/2007-02-05-BitCast.ll --- Diffs of the changes: (+5 -1) ConstantFolding.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.134 llvm/lib/VMCore/ConstantFolding.cpp:1.135 --- llvm/lib/VMCore/ConstantFolding.cpp:1.134 Tue Jan 30 22:40:28 2007 +++ llvm/lib/VMCore/ConstantFolding.cpp Mon Feb 5 20:22:56 2007 @@ -296,8 +296,12 @@ // Handle ConstantFP input. if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) { // FP -> Integral. - if (DestTy->isInteger()) + if (DestTy == Type::Int32Ty) { + return ConstantInt::get(DestTy, FloatToBits(FP->getValue())); + } else { + assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!"); return ConstantInt::get(DestTy, DoubleToBits(FP->getValue())); + } } return 0; default: _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits