diff options
author | Adam Nemet <anemet@apple.com> | 2017-03-29 20:39:49 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2017-03-29 20:39:49 +0000 |
commit | 66c3ea0d3b0f08172cab81f628a2f47d023af2ba (patch) | |
tree | a87770d5cf38c99f3d3b7966c7ae91875266bfd8 /lib/Sema | |
parent | 02bf8398f06ccc4cf21ceab6b89ca36b8a61075e (diff) | |
download | clang-66c3ea0d3b0f08172cab81f628a2f47d023af2ba.tar.gz |
Use FPContractModeKind universally
FPContractModeKind is the codegen option flag which is already ternary (off,
on, fast). This makes it universally the type for the contractable info
across the front-end:
* In FPOptions (i.e. in the Sema + in the expression nodes).
* In LangOpts::DefaultFPContractMode which is the option that initializes
FPOptions in the Sema.
Another way to look at this change is that before fp-contractable on/off were
the only states handled to the front-end:
* For "on", FMA folding was performed by the front-end
* For "fast", we simply forwarded the flag to TargetOptions to handle it in
LLVM
Now off/on/fast are all exposed because for fast we will generate
fast-math-flags during CodeGen.
This is toward moving fp-contraction=fast from an LLVM TargetOption to a
FastMathFlag in order to fix PR25721.
Differential Revision: https://reviews.llvm.org/D31167
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaAttr.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp index 992eac9019..34744cbdd9 100644 --- a/lib/Sema/SemaAttr.cpp +++ b/lib/Sema/SemaAttr.cpp @@ -450,13 +450,16 @@ void Sema::ActOnPragmaVisibility(const IdentifierInfo* VisType, void Sema::ActOnPragmaFPContract(tok::OnOffSwitch OOS) { switch (OOS) { case tok::OOS_ON: - FPFeatures.setFPContractable(true); + FPFeatures.setAllowFPContractWithinStatement(); break; case tok::OOS_OFF: - FPFeatures.setFPContractable(false); + FPFeatures.setDisallowFPContract(); break; case tok::OOS_DEFAULT: - FPFeatures.setFPContractable(getLangOpts().DefaultFPContract); + if (getLangOpts().getDefaultFPContractMode() == LangOptions::FPC_On) + FPFeatures.setAllowFPContractWithinStatement(); + else + FPFeatures.setDisallowFPContract(); break; } } |