Page MenuHomePhabricator

[Frontend] The macro that describes the Objective-C bool type should be defined in C as well
ClosedPublic

Authored by arphaman on Jan 5 2017, 2:50 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 83210.Jan 5 2017, 2:50 AM
arphaman retitled this revision from to [Frontend] The macro that describes the Objective-C bool type should be defined in C as well.
arphaman updated this object.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: cfe-commits.
arphaman edited reviewers, added: gparker42; removed: doug.gregor.Jan 5 2017, 2:53 AM

The "!LangOpts.CPlusPlus" doesn't make sense to me. You're presumably defining this macro in C because the Objective-C runtime is usable from C, but that same logic applies to C++ code. It seems like we should be defining this macro unconditionally.

arphaman updated this revision to Diff 83354.Jan 6 2017, 2:41 AM

Set the macro unconditionally.

The "!LangOpts.CPlusPlus" doesn't make sense to me. You're presumably defining this macro in C because the Objective-C runtime is usable from C, but that same logic applies to C++ code. It seems like we should be defining this macro unconditionally.

That's true. I was initially reluctant to define it for C++ as well since this macro is available on all platforms, but I guess there's no way around this.

mehdi_amini accepted this revision.Jan 19 2017, 5:50 PM
mehdi_amini added a subscriber: mehdi_amini.

LGTM.

This revision is now accepted and ready to land.Jan 19 2017, 5:50 PM
This revision was automatically updated to reflect the committed changes.