Revert the recent patches to "fix" ConstantFP::isValueValidForType. None
authorReid Spencer <rspencer@reidspencer.com>
Tue, 7 Dec 2004 07:38:08 +0000 (07:38 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 7 Dec 2004 07:38:08 +0000 (07:38 +0000)
of them seem to work everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18598 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Constants.cpp

index 6aa218c74e74ad07a9814bb0c619633e7ceaaa72..97e4fa565c7e06982bca4b299968e81c01bbe9d0 100644 (file)
@@ -21,7 +21,6 @@
 #include "llvm/ADT/StringExtras.h"
 #include <algorithm>
 #include <iostream>
-#include "math.h"
 using namespace llvm;
 
 ConstantBool *ConstantBool::True  = new ConstantBool(true);
@@ -441,11 +440,8 @@ bool ConstantFP::isValueValidForType(const Type *Ty, double Val) {
   default:
     return false;         // These can't be represented as floating point!
 
+    // TODO: Figure out how to test if a double can be cast to a float!
   case Type::FloatTyID:
-    // Since we're passed a double but the ConstantFP is of type float, make
-    // sure that the double value is in the range of a float
-    return isinf(Val) || isnan(Val) || (Val >= -HUGE_VALF && Val <= HUGE_VALF);
-    
   case Type::DoubleTyID:
     return true;          // This is the largest type...
   }