[PATCH] D86921: [FPEnv] Partially implement #pragma STDC FENV_ROUND

Serge Pavlov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 1 02:50:22 PDT 2020


sepavloff created this revision.
sepavloff added reviewers: rsmith, rjmccall, kpn, andrew.w.kaylor, steven_wu, mibintc, shafik.
Herald added a subscriber: dexonsmith.
Herald added a project: clang.
sepavloff requested review of this revision.

This change implements pragma STDC FENV_ROUND, which is introduced by
the extension to standard (TS 18661-1). The pragma is implemented only
in frontend, it sets apprpriate state of FPOptions stored in Sema. Use
of these bits in constant evaluation adn/or code generator is not in the
scope of this change.

Parser issues warning on unsuppored pragma when it encounteres pragma
STDC FENV_ROUND, however it makes syntax checks and updates Sema state
as if the pragma were supported.

Primary purpose of the partial implementation is to facilitate
development of non-default floating poin environment. Previously a
developer cannot set non-default rounding mode in sources, this mades
preparing tests for say constant evaluation  substantially complicated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86921

Files:
  clang/include/clang/Basic/DiagnosticParseKinds.td
  clang/include/clang/Basic/TokenKinds.def
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/Sema.h
  clang/lib/Parse/ParsePragma.cpp
  clang/lib/Parse/ParseStmt.cpp
  clang/lib/Parse/Parser.cpp
  clang/lib/Sema/SemaAttr.cpp
  clang/test/AST/ast-dump-fpfeatures.cpp
  clang/test/Parser/pragma-fenv_round.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86921.289110.patch
Type: text/x-patch
Size: 12438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200901/22d56700/attachment-0001.bin>


More information about the cfe-commits mailing list