summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/LangOptions.h
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-03-29 21:24:19 +0000
committerAdam Nemet <anemet@apple.com>2017-03-29 21:24:19 +0000
commit38e2463d97e1fb64b28547792d43db157f8e4b45 (patch)
tree8c1037c002829172cec4969dfae4bed627bda023 /include/clang/Basic/LangOptions.h
parent66c3ea0d3b0f08172cab81f628a2f47d023af2ba (diff)
Revert "Use FPContractModeKind universally"
This reverts commit r299027. It's causing a test failure in clang's CodeGenCUDE/fp-contract.cu git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/LangOptions.h')
-rw-r--r--include/clang/Basic/LangOptions.h31
1 files changed, 6 insertions, 25 deletions
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index 16abf9b7bb..cfbcbecc5f 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -88,12 +88,6 @@ public:
MSVC2015 = 19
};
- enum FPContractModeKind {
- FPC_Off, // Form fused FP ops only where result will not be affected.
- FPC_On, // Form fused FP ops according to FP_CONTRACT rules.
- FPC_Fast // Aggressively fuse FP ops (E.g. FMA).
- };
-
public:
/// \brief Set of enabled sanitizers.
SanitizerSet Sanitize;
@@ -186,35 +180,22 @@ public:
/// \brief Floating point control options
class FPOptions {
public:
- FPOptions() : fp_contract(LangOptions::FPC_Off) {}
+ FPOptions() : fp_contract(0) {}
- // Used for serializing.
- explicit FPOptions(unsigned I)
- : fp_contract(static_cast<LangOptions::FPContractModeKind>(I)) {}
+ explicit FPOptions(unsigned I) : fp_contract(I) {}
explicit FPOptions(const LangOptions &LangOpts)
- : fp_contract(LangOpts.getDefaultFPContractMode()) {}
+ : fp_contract(LangOpts.DefaultFPContract) {}
- bool allowFPContractWithinStatement() const {
- return fp_contract == LangOptions::FPC_On;
- }
- bool allowFPContractAcrossStatement() const {
- return fp_contract == LangOptions::FPC_Fast;
- }
- void setAllowFPContractWithinStatement() {
- fp_contract = LangOptions::FPC_On;
- }
- void setAllowFPContractAcrossStatement() {
- fp_contract = LangOptions::FPC_Fast;
- }
- void setDisallowFPContract() { fp_contract = LangOptions::FPC_Off; }
+ void setFPContractable(bool V) { fp_contract = V; }
+ bool isFPContractable() const { return fp_contract; }
/// Used to serialize this.
unsigned getInt() const { return fp_contract; }
private:
/// Adjust BinaryOperator::FPFeatures to match the bit-field size of this.
- LangOptions::FPContractModeKind fp_contract : 2;
+ unsigned fp_contract : 1;
};
/// \brief Describes the kind of translation unit being processed.