Adding a note about the macro __FLT_EVAL_METHOD__; NFC

This is to clarify that the macro __FLT_EVAL_METHOD__ is not pre-
defined like other preprocessor macros. It will not appear when
preprocessor macros are dumped.

Differential Revision: https://reviews.llvm.org/D124033
This commit is contained in:
Zahira Ammarguellat 2022-08-23 14:35:57 -04:00 committed by Aaron Ballman
parent e329788bf8
commit ba8b5ff874
1 changed files with 9 additions and 6 deletions

View File

@ -1631,12 +1631,15 @@ Note that floating-point operations performed as part of constant initialization
A note about ``__FLT_EVAL_METHOD__``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The macro ``__FLT_EVAL_METHOD__`` will expand to either the value set from the
command line option ``ffp-eval-method`` or to the value from the target info
setting. The ``__FLT_EVAL_METHOD__`` macro cannot expand to the correct
evaluation method in the presence of a ``#pragma`` which alters the evaluation
method. An error is issued if ``__FLT_EVAL_METHOD__`` is expanded inside a scope
modified by ``#pragma clang fp eval_method``.
The ``__FLT_EVAL_METHOD__`` is not defined as a traditional macro, and so it
will not appear when dumping preprocessor macros. Instead, the value
``__FLT_EVAL_METHOD__`` expands to is determined at the point of expansion
either from the value set by the ``-ffp-eval-method`` command line option or
from the target. This is because the ``__FLT_EVAL_METHOD__`` macro
cannot expand to the correct evaluation method in the presence of a ``#pragma``
which alters the evaluation method. An error is issued if
``__FLT_EVAL_METHOD__`` is expanded inside a scope modified by
``#pragma clang fp eval_method``.
.. _fp-constant-eval: