Use FPContractModeKind universally
authorAdam Nemet <anemet@apple.com>
Wed, 29 Mar 2017 20:39:49 +0000 (20:39 +0000)
committerAdam Nemet <anemet@apple.com>
Wed, 29 Mar 2017 20:39:49 +0000 (20:39 +0000)
commit32093a1c28250bc08a8b69d63aa91c358f7d42fb
treeb1379645fb077412219c7d6430ea99af88e5e96c
parentd6d6a3f2eecd44b2a261ae0ef9239ea8f6385a66
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

llvm-svn: 299027
clang/include/clang/AST/Expr.h
clang/include/clang/AST/ExprCXX.h
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Frontend/CodeGenOptions.def
clang/include/clang/Frontend/CodeGenOptions.h
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Sema/SemaAttr.cpp