[PATCH] D90316: [FPEnv] Diagnose pragmas FENV_ROUND,_ACCESS and float_control if target does not support StrictFP

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 29 10:22:14 PDT 2020


aaron.ballman added inline comments.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:107
+    if (!PP.getTargetInfo().hasStrictFP() && !PP.getLangOpts().ExpStrictFP) {
+      PP.Diag(Tok.getLocation(), diag::warn_pragma_fp_ignored)
+          << "FENV_ACCESS";
----------------
Can you fix the lint issues (run the patch through clang-format)? Same for below.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:2967
+    PP.Diag(Tok.getLocation(), diag::warn_pragma_fp_ignored)
+        << PragmaName.getIdentifierInfo()->getName();
+    return;
----------------
Can you pass in `PragmaName` directly, or does that do unfortunate things with single quotes?


================
Comment at: clang/test/Parser/pragma-fp-warn.c:11-13
+// expected-warning at +8 {{'#pragma FENV_ROUND' is not supported on this target - ignored}}
+// expected-warning at +5 {{'#pragma FENV_ACCESS' is not supported on this target - ignored}}
+// expected-warning at +2 {{'#pragma float_control' is not supported on this target - ignored}}
----------------
I'd appreciate reversing the order of the comments so that they're in the same order as the pragmas below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90316



More information about the cfe-commits mailing list