Add some more PS4 driver settings related to rtti and exceptions.
authorFilipe Cabecinhas <me@filcab.net>
Thu, 29 Jan 2015 23:56:43 +0000 (23:56 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Thu, 29 Jan 2015 23:56:43 +0000 (23:56 +0000)
commit28f353c7d0d31fbaf6176704cd37001086b94a6e
treea0b9609b903b81abf54871df7c497f72cf08950d
parentfbd9fbababafc51d1b275bbd286966f6d9dda3a4
Add some more PS4 driver settings related to rtti and exceptions.

Summary:
The PS4 defaults to -fno-rtti, and has to have rtti enabled when enabling
exceptions.

This commit makes clang add the -fno-rtti by default on the PS4, unless
-frtti was passed in.

It also diagnoses misuses for the PS4:
- Exceptions need rtti. Warn and enable rtti if no rtti flag was passed,
  error if -fno-rtti was passed.

I also added a more general warning for when -fno-rtti is the default
(currently it's only on the PS4) and the vptr sanitizer is on.

Fixed a few tests, due to different flag order when passing cc1 arguments.

Reviewers: chandlerc

Subscribers: cfe-commits

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

llvm-svn: 227518
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/Tools.cpp
clang/test/Driver/rtti-options.cpp [new file with mode: 0644]