Author: Kevin P. Neal Date: 2020-11-12T12:51:35-05:00 New Revision: ac523d2de51c4119ae6233200af07599d61de1fc
URL: https://github.com/llvm/llvm-project/commit/ac523d2de51c4119ae6233200af07599d61de1fc DIFF: https://github.com/llvm/llvm-project/commit/ac523d2de51c4119ae6233200af07599d61de1fc.diff LOG: [FPEnv][Clang][Driver] Use MarshallingInfoFlag for -fexperimental-strict-floating-point As of D80952 we are disabling strict floating point on all hosts except those that are explicitly listed as supported. Use of strict floating point on other hosts requires use of the -fexperimental-strict-floating-point flag. This is to avoid bugs like "https://bugs.llvm.org/show_bug.cgi?id=45329" (which has an incorrect link in the previous review). In the review for D80952 I was asked to mark the -fexperimental option as a MarshallingInfoFlag. This patch does exactly that. Differential Revision: https://reviews.llvm.org/D88987 Added: Modified: clang/include/clang/Driver/Options.td clang/lib/Frontend/CompilerInvocation.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 6df4a0222484..245e6765d613 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1308,7 +1308,8 @@ def fexperimental_new_pass_manager : Flag<["-"], "fexperimental-new-pass-manager HelpText<"Enables an experimental new pass manager in LLVM.">; def fexperimental_strict_floating_point : Flag<["-"], "fexperimental-strict-floating-point">, Group<f_clang_Group>, Flags<[CC1Option]>, - HelpText<"Enables experimental strict floating point in LLVM.">; + HelpText<"Enables experimental strict floating point in LLVM.">, + MarshallingInfoFlag<"LangOpts->ExpStrictFP">; def finput_charset_EQ : Joined<["-"], "finput-charset=">, Group<f_Group>; def fexec_charset_EQ : Joined<["-"], "fexec-charset=">, Group<f_Group>; def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>, Flags<[CC1Option]>, diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b2ce88f6cf6b..ffcc3d359e62 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3335,9 +3335,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val; } - if (Args.hasArg(OPT_fexperimental_strict_floating_point)) - Opts.ExpStrictFP = true; - auto FPRM = llvm::RoundingMode::NearestTiesToEven; if (Args.hasArg(OPT_frounding_math)) { FPRM = llvm::RoundingMode::Dynamic; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits