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.

Attachment: clang-fp-contract-2.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to