[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Mon Dec 6 22:47:00 PST 2004
Changes in directory llvm/lib/VMCore:
Constants.cpp updated: 1.113 -> 1.114
---
Log message:
Fix check for valid floats. Also use and HUGE_VALF instead
of std::numeric_limits, because they work in more platforms.
---
Diffs of the changes: (+1 -10)
Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.113 llvm/lib/VMCore/Constants.cpp:1.114
--- llvm/lib/VMCore/Constants.cpp:1.113 Mon Dec 6 16:18:37 2004
+++ llvm/lib/VMCore/Constants.cpp Tue Dec 7 00:46:50 2004
@@ -21,7 +21,6 @@
#include "llvm/ADT/StringExtras.h"
#include <algorithm>
#include <iostream>
-#include <limits>
using namespace llvm;
ConstantBool *ConstantBool::True = new ConstantBool(true);
@@ -443,15 +442,7 @@
// TODO: Figure out how to test if a double can be cast to a float!
case Type::FloatTyID:
- return
- (std::numeric_limits<double>::has_infinity &&
- std::numeric_limits<float>::has_infinity &&
- Val == std::numeric_limits<double>::infinity()) ||
- (std::numeric_limits<double>::has_quiet_NaN &&
- std::numeric_limits<float>::has_quiet_NaN &&
- Val == std::numeric_limits<double>::quiet_NaN()) ||
- (Val >= -std::numeric_limits<float>::max() &&
- Val <= std::numeric_limits<float>::max());
+ 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