summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitac4f66ff24e27bacd19828d9f9970d0311fbb129 (patch)
treef150ae5b392170b5a4651a7999e9dc6019ae0555 /llvm/lib/Target/TargetMachine.cpp
parent5b917e48a2b0d4bbee96bd4732e3fa094b84ba7f (diff)
downloadbcm5719-llvm-ac4f66ff24e27bacd19828d9f9970d0311fbb129.tar.gz
bcm5719-llvm-ac4f66ff24e27bacd19828d9f9970d0311fbb129.zip
-enable-unsafe-fp-math implies -enable-finite-only-fp-math
llvm-svn: 28437
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 28f3ae88a72..bf70d12a6b8 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/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; }
+};
OpenPOWER on IntegriCloud