This is an archive of the discontinued LLVM Phabricator instance.

Add some more PS4 driver settings related to rtti and exceptions.
ClosedPublic

Authored by filcab on Jan 29 2015, 7:16 AM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

filcab updated this revision to Diff 18957.Jan 29 2015, 7:16 AM
filcab retitled this revision from to Add some more PS4 driver settings related to rtti and exceptions..
filcab updated this object.
filcab edited the test plan for this revision. (Show Details)
filcab added a reviewer: chandlerc.
filcab added a subscriber: Unknown Object (MLST).
filcab updated this revision to Diff 18963.Jan 29 2015, 7:52 AM

Fixed the logic (if and else branches were opposite to what they should)
Fixed the test.

echristo added a subscriber: echristo.

Seems pretty reasonable, why the move of the ObjC code? (One weird whitespace change that can probably go too).

-eric

lib/Driver/Tools.cpp
1988 ↗(On Diff #18963)

...?

We need objcRuntime for addExceptionArgs.
I'll fix the white space problem.

Thanks,

Filipe
echristo edited edge metadata.Jan 29 2015, 11:34 AM

Add some comments on the ordering being important if you don't mind then?

Thanks! (Otherwise LGTM if ugly :)

-eric

filcab updated this revision to Diff 19002.Jan 29 2015, 3:54 PM
filcab edited edge metadata.

Updating with Eric's comments.
Removed the shuffling of some other command line switch processing which wasn't needed in this version of the patch.

This revision was automatically updated to reflect the committed changes.