Demoting CHelpers.h to include/llvm/Support.
[oota-llvm.git] / lib / VMCore / ConstantFold.cpp
index 0c1d7f73ae1cec2b75f9470d9385f5f1d8002ae2..73ca47a9aa56c565f3e69b5e19d2c698d15fcb10 100644 (file)
@@ -194,11 +194,8 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
       APFloat V = FPC->getValueAPF();
       uint64_t x[2]; 
       uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
-      APFloat::opStatus status = V.convertToInteger(x, DestBitWidth, 
-                             opc==Instruction::FPToSI,
-                             APFloat::rmNearestTiesToEven);
-      if (status!=APFloat::opOK && status!=APFloat::opInexact)
-        return 0; // give up
+      (void) V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI,
+                                APFloat::rmTowardZero);
       APInt Val(DestBitWidth, 2, x);
       return ConstantInt::get(Val);
     }