[PATCH] D79735: FP LangOpts should not be dependent on CGOpts
Melanie Blower via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 11 12:56:30 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG01dc694ccb86: FP LangOpts should not be dependent on CGOpt This bug was observed by Appleā¦ (authored by mibintc).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79735/new/
https://reviews.llvm.org/D79735
Files:
clang/lib/Frontend/CompilerInvocation.cpp
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -2454,7 +2454,7 @@
static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
const TargetOptions &TargetOpts,
- PreprocessorOptions &PPOpts, CodeGenOptions &CGOpts,
+ PreprocessorOptions &PPOpts,
DiagnosticsEngine &Diags) {
// FIXME: Cleanup per-file based stuff.
LangStandard::Kind LangStd = LangStandard::lang_unspecified;
@@ -3188,13 +3188,21 @@
Opts.UnsafeFPMath = Args.hasArg(OPT_menable_unsafe_fp_math) ||
Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
Args.hasArg(OPT_cl_fast_relaxed_math);
- Opts.AllowFPReassoc = Opts.FastMath || CGOpts.Reassociate;
- Opts.NoHonorNaNs =
- Opts.FastMath || CGOpts.NoNaNsFPMath || Opts.FiniteMathOnly;
- Opts.NoHonorInfs =
- Opts.FastMath || CGOpts.NoInfsFPMath || Opts.FiniteMathOnly;
- Opts.NoSignedZero = Opts.FastMath || CGOpts.NoSignedZeros;
- Opts.AllowRecip = Opts.FastMath || CGOpts.ReciprocalMath;
+ Opts.AllowFPReassoc = Opts.FastMath || Args.hasArg(OPT_mreassociate);
+ Opts.NoHonorNaNs = Opts.FastMath || Opts.FiniteMathOnly ||
+ Args.hasArg(OPT_menable_no_nans) ||
+ Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
+ Args.hasArg(OPT_cl_finite_math_only) ||
+ Args.hasArg(OPT_cl_fast_relaxed_math);
+ Opts.NoHonorInfs = Opts.FastMath || Opts.FiniteMathOnly ||
+ Args.hasArg(OPT_menable_no_infinities) ||
+ Args.hasArg(OPT_cl_finite_math_only) ||
+ Args.hasArg(OPT_cl_fast_relaxed_math);
+ Opts.NoSignedZero = Opts.FastMath || (Args.hasArg(OPT_fno_signed_zeros) ||
+ Args.hasArg(OPT_cl_no_signed_zeros) ||
+ Args.hasArg(OPT_cl_unsafe_math_optimizations) ||
+ Args.hasArg(OPT_cl_fast_relaxed_math));
+ Opts.AllowRecip = Opts.FastMath || Args.hasArg(OPT_freciprocal_math);
// Currently there's no clang option to enable this individually
Opts.ApproxFunc = Opts.FastMath;
@@ -3652,7 +3660,7 @@
// Other LangOpts are only initialized when the input is not AST or LLVM IR.
// FIXME: Should we really be calling this for an Language::Asm input?
ParseLangArgs(LangOpts, Args, DashX, Res.getTargetOpts(),
- Res.getPreprocessorOpts(), Res.getCodeGenOpts(), Diags);
+ Res.getPreprocessorOpts(), Diags);
if (Res.getFrontendOpts().ProgramAction == frontend::RewriteObjC)
LangOpts.ObjCExceptions = 1;
if (T.isOSDarwin() && DashX.isPreprocessed()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79735.263252.patch
Type: text/x-patch
Size: 2878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200511/8ae36b29/attachment.bin>
More information about the cfe-commits
mailing list