Move -mfpmath handling to -cc1 and implement it for x86.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Aug 2013 21:59:03 +0000 (21:59 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Aug 2013 21:59:03 +0000 (21:59 +0000)
commiteb26547177b9c5d1330100a7c988e8a792c07eba
treeb1c465f4cd459ed09bad95ded37731fc4b8ce715
parent3cba495abca1f41a17f4092c5cf3f01374271adc
Move -mfpmath handling to -cc1 and implement it for x86.

The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

llvm-svn: 188939
clang/include/clang/Basic/DiagnosticCommonKinds.td
clang/include/clang/Basic/TargetInfo.h
clang/include/clang/Basic/TargetOptions.h
clang/include/clang/Driver/CC1Options.td
clang/lib/Basic/Targets.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Driver/arm-mfpmath.c [deleted file]
clang/test/Frontend/mfpmath.c [new file with mode: 0644]