summaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-05-23 18:18:46 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-05-23 18:18:46 +0000
commit80235d508e5f7a9603ef43ba6625984173ff0323 (patch)
tree66ce594da4fbebdc0f37975d9f8aa819d6f03cc6 /lib/Target/TargetMachine.cpp
parent1fd8a4f65da140e5f340ccb79a33ed86fd82d169 (diff)
downloadexternal_llvm-80235d508e5f7a9603ef43ba6625984173ff0323.zip
external_llvm-80235d508e5f7a9603ef43ba6625984173ff0323.tar.gz
external_llvm-80235d508e5f7a9603ef43ba6625984173ff0323.tar.bz2
-enable-unsafe-fp-math implies -enable-finite-only-fp-math
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetMachine.cpp')
-rw-r--r--lib/Target/TargetMachine.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp
index 28f3ae8..bf70d12 100644
--- a/lib/Target/TargetMachine.cpp
+++ b/lib/Target/TargetMachine.cpp
@@ -26,7 +26,7 @@ namespace llvm {
bool NoFramePointerElim;
bool NoExcessFPPrecision;
bool UnsafeFPMath;
- bool FiniteOnlyFPMath;
+ bool FiniteOnlyFPMathOption;
Reloc::Model RelocationModel;
};
namespace {
@@ -52,7 +52,7 @@ namespace {
cl::opt<bool, true>
EnableFiniteOnltFPMath("enable-finite-only-fp-math",
cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
- cl::location(FiniteOnlyFPMath),
+ cl::location(FiniteOnlyFPMathOption),
cl::init(false));
cl::opt<llvm::Reloc::Model, true>
DefRelocationModel(
@@ -93,3 +93,11 @@ Reloc::Model TargetMachine::getRelocationModel() {
void TargetMachine::setRelocationModel(Reloc::Model Model) {
RelocationModel = Model;
}
+
+namespace llvm {
+ /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
+ /// option is specified on the command line. If this returns false (default),
+ /// the code generator is not allowed to assume that FP arithmetic arguments
+ /// and results are never NaNs or +-Infs.
+ bool FiniteOnlyFPMath() { return UnsafeFPMath || FiniteOnlyFPMathOption; }
+};