]> granicus.if.org Git - clang/commit
[Driver] Restructure handling of -ffast-math and similar options
authorJohn Brawn <john.brawn@arm.com>
Wed, 15 Mar 2017 14:03:32 +0000 (14:03 +0000)
committerJohn Brawn <john.brawn@arm.com>
Wed, 15 Mar 2017 14:03:32 +0000 (14:03 +0000)
commit5bf358b62de7dc5c36779d02252153618401d735
treed173bed95fb5dce6889dd367d63965fea857764b
parent7f4f88288af79915c1dec39f41be06a31ffd453e
[Driver] Restructure handling of -ffast-math and similar options

The way -ffast-math and the various related options to tweak floating-point
handling are handled is inflexible and rather confusing. This patch restructures
things so that we go through the options adjusting our idea of what's enabled as
we go, instead of trying to figure each individual thing out by working
backwards from the end, as this makes the behaviour of each individual option
more clear.

Doing it this way also means we get gcc-compatible behaviour for when the
__FAST_MATH__ and __FINITE_MATH_ONLY__ macros are defined, as they should depend
on the final set of features that are enabled and not just on -ffast-math and
-ffinite-math-only specifically.

Differential Revision: http://reviews.llvm.org/D30582

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297837 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains/Clang.cpp
test/Driver/fast-math.c