We need to propagate the debug location information even when dealing with the
[oota-llvm.git] / lib / VMCore / ConstantFold.cpp
index 5f7cbcd0b60b5cd50a664a1db2b47247372c66a6..ff4d897e54a8b945d1d49ff959a424f49452b943 100644 (file)
@@ -161,17 +161,12 @@ static Constant *FoldBitCast(Constant *V, const Type *DestTy) {
     // Otherwise, can't fold this (vector?)
     return 0;
   }
-  
+
   // Handle ConstantFP input.
-  if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
+  if (const ConstantFP *FP = dyn_cast<ConstantFP>(V))
     // FP -> Integral.
-    if (DestTy == Type::Int32Ty) {
-      return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
-    } else {
-      assert(DestTy == Type::Int64Ty && "only support f32/f64 for now!");
-      return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
-    }
-  }
+    return ConstantInt::get(FP->getValueAPF().bitcastToAPInt());
+
   return 0;
 }