Skip to content

Commit

Permalink
Addressed review comments and fixed the -menable_no_infs option.
Browse files Browse the repository at this point in the history
  • Loading branch information
zahiraam committed Jul 17, 2024
1 parent 1d46333 commit 4e0afa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -7762,7 +7762,7 @@ def mreassociate : Flag<["-"], "mreassociate">,
def menable_no_nans : Flag<["-"], "menable-no-nans">,
HelpText<"Allow optimization to assume there are no NaNs.">,
MarshallingInfoFlag<LangOpts<"NoHonorNaNs">>, ImpliedByAnyOf<[ffast_math.KeyPath]>;
def menable_no_infinities : Flag<["-"], "menable-no-infs">,
def menable_no_infs : Flag<["-"], "menable-no-infs">,
HelpText<"Allow optimization to assume there are no infinities.">,
MarshallingInfoFlag<LangOpts<"NoHonorInfs">>, ImpliedByAnyOf<[ffast_math.KeyPath]>;

Expand Down
9 changes: 4 additions & 5 deletions clang/lib/Basic/Targets/OSTargets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,10 @@ static void addVisualCDefines(const LangOptions &Opts, MacroBuilder &Builder) {
// "Under /fp:precise and /fp:strict, the compiler doesn't do any mathematical
// transformation unless the transformation is guaranteed to produce a bitwise
// identical result."
const bool any_imprecise_flags =
Opts.FastMath || (Opts.NoHonorInfs && Opts.NoHonorNaNs) ||
Opts.UnsafeFPMath || Opts.AllowFPReassoc || Opts.NoHonorNaNs ||
Opts.NoHonorInfs || Opts.NoSignedZero || Opts.AllowRecip ||
Opts.ApproxFunc;
const bool any_imprecise_flags = Opts.FastMath || Opts.UnsafeFPMath ||
Opts.AllowFPReassoc || Opts.NoHonorNaNs ||
Opts.NoHonorInfs || Opts.NoSignedZero ||
Opts.AllowRecip || Opts.ApproxFunc;

// "Under both /fp:precise and /fp:fast, the compiler generates code intended
// to run in the default floating-point environment."
Expand Down

0 comments on commit 4e0afa2

Please sign in to comment.