Revert the recent patches to "fix" ConstantFP::isValueValidForType. None

of them seem to work everywhere.

llvm-svn: 18598
This commit is contained in:
Reid Spencer 2004-12-07 07:38:08 +00:00
parent ae056bdd36
commit b95f8ab3ef
1 changed files with 1 additions and 5 deletions

View 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...
}