[clang] [Clang][Driver] Override complex number calculation method by -fno-fast-math (PR #132680)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 3 01:17:26 PDT 2025
s-watanabe314 wrote:
@andykaylor
I've modified the code to output the warning message proposed [here](https://github.com/llvm/llvm-project/pull/132680#issuecomment-2775345211). Please review it.
I considered an implementation that wouldn't add a new variable `LastComplexRangeOption`, but I couldn't avoid affecting existing warnings. Specifically, there's a problem with the test in [fp-model.c](https://github.com/llvm/llvm-project/blob/972ecc31f72e16ae4a9337ce6bc85059404eaf4f/clang/test/Driver/fp-model.c#L206-L208). This test expects the warning message `warning: overriding '-fcomplex-arithmetic=basic' option with '-fcomplex-arithmetic=promoted'` for `clang -ffast-math -ffp-model=fast`. I'm not sure if this test is correct, but I believe a new variable is necessary to avoid affecting it. If we stored the history of non-Gcc options in the existing `GccComplexRangeOption`, the above warning message would become `overriding '-ffast-math' option with '-ffp-model=fast'`. Should I also fix all warnings related to complex range options other than `-fno-fast-math`?
https://github.com/llvm/llvm-project/pull/132680
More information about the cfe-commits
mailing list