[cfe-commits] [PATCH] FP_CONTRACT pragma support.

Lang Hames lhames at gmail.com
Wed Sep 26 17:12:50 PDT 2012


Hi All,

This patch adds support for the FP_CONTRACT pragma to clang. It adds a bit
to BinaryOperator and CXXOperatorCallExpr to track the FP_CONTRACT pragma
state as each AST node is constructed. Pragma state is made to follow scope
correctly by having an RAII object save and restore the state when the
parser encounters a new compound statement body. The -ffp-contract option
is tested during codegen, and fmuladd intrinsics (representing fusing
opportunities) are output only if --ffp-contract=on.

This patch does NOT include warnings/errors for specifying FP_CONTRACT in
invalid contexts that could be confusing (e.g. introducing FP_CONTRACT at
class scope). I think it's reasonable to start by supporting valid use
cases, and add restrictions/diagnostics in a follow-up patch.

Comments and feedback most welcome.

Cheers,
Lang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120926/56fdf0ac/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-fp-contract-2.patch
Type: application/octet-stream
Size: 13831 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120926/56fdf0ac/attachment.obj>


More information about the cfe-commits mailing list