This is an archive of the discontinued LLVM Phabricator instance.

[TargetInfo] Set 'UseSignedCharForObjCBool' to false by default
Needs ReviewPublic

Authored by arphaman on Feb 9 2017, 8:48 AM.

Details

Summary

The target-specific flag 'UseSignedCharForObjCBool' is used to determine the type for the Objective-C BOOL type. We should set it to false by default so that new targets can avoid setting it to true.

Diff Detail

Event Timeline

arphaman created this revision.Feb 9 2017, 8:48 AM
aaron.ballman added inline comments.
lib/Basic/Targets.cpp
4340–4341 ↗(On Diff #87818)

Rather than using an if statement, why not assign directly? UseSignedCharForObjCBool = !T.isWatchOS();

4772–4773 ↗(On Diff #87818)

Same here.

arphaman updated this revision to Diff 141045.Apr 4 2018, 1:46 PM
arphaman marked 2 inline comments as done.

Sorry, missed the comments last year. Updated.

arphaman updated this revision to Diff 141070.Apr 4 2018, 3:14 PM

Only make the change for the Darwin platforms to avoid ObjC ABI breakage for non-Darwin platforms.

aaron.ballman added inline comments.Apr 10 2018, 6:55 AM
lib/Basic/Targets/PPC.h
349

Do you need to specify this? Isn't it handled by the TargetInfo constructor?

364

Likewise.