[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

Zahira Ammarguellat via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 8 14:25:53 PST 2022


zahiraam added inline comments.


================
Comment at: clang/lib/Lex/PPMacroExpansion.cpp:1600
+    } else {
+      OS << getTUFPEvalMethod();
+      // __FLT_EVAL_METHOD__ expands to a simple numeric value.
----------------
andrew.w.kaylor wrote:
> It looks like you've got tabs in the code here.
No. I think that just means that the block of code was shifted  by a few spaces because it's in a condition now.


================
Comment at: clang/lib/Sema/SemaAttr.cpp:521
+    // Fast-math is enabled.
+    PP.setCurrentFPEvalMethod(
+        Loc, LangOptions::FPEvalMethodKind::FEM_Indeterminable);
----------------
andrew.w.kaylor wrote:
> Why don't you need the reverse of this in the Precise and Pop cases? Also, why is it necessary to call getCurrentFPEvalMethod() immediately after setting it?
The call to getCurrentFPEvalMethod() was just left over debugging. Removed it.


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

https://reviews.llvm.org/D121122



More information about the cfe-commits mailing list