[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp

Reid Spencer reid at x10sys.com
Mon Dec 6 23:38:18 PST 2004



Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.116 -> 1.117
---
Log message:

Revert the recent patches to "fix" ConstantFP::isValueValidForType. None
of them seem to work everywhere.


---
Diffs of the changes:  (+1 -5)

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.116 llvm/lib/VMCore/Constants.cpp:1.117
--- llvm/lib/VMCore/Constants.cpp:1.116	Tue Dec  7 01:08:08 2004
+++ llvm/lib/VMCore/Constants.cpp	Tue Dec  7 01:38:08 2004
@@ -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 @@
   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...
   }






More information about the llvm-commits mailing list