[PATCH] D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 12:33:00 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Parse/ParseStmt.cpp:1065
 
+  if (Tok.isNot(tok::annot_pragma_fp) &&
+      getLangOpts().getFPEvalMethod() != LangOptions::FEM_UnsetOnCommandLine &&
----------------
zahiraam wrote:
> aaron.ballman wrote:
> > This looks like it's going to diagnose on every compound statement regardless of whether the function contains any floating-point operations at all. If so, that's way too chatty.
> > 
> > It seems like the issue here is "the command line options disagree", so why is this not a frontend warning when processing the command line options? 
> I tried to do that initially but I don't have a Location for the diagnostic.
We issue plenty of diagnostics when command line options don't match expectations, as examples:

https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/CompilerInvocation.cpp#L525
https://github.com/llvm/llvm-project/blob/main/clang/lib/Frontend/CompilerInvocation.cpp#L1241

(and so on).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122155/new/

https://reviews.llvm.org/D122155



More information about the cfe-commits mailing list