Page MenuHomePhabricator

[Clang][Sema] Use VersionMap from SDKSettings for remapping tvOS and watchOS availability
ClosedPublic

Authored by egorzhdan on Jan 7 2022, 10:14 AM.

Details

Summary

This makes the mapping between iOS & tvOS/watchOS versions more accurate. For example, iOS 9.3 now gets correctly mapped into tvOS 9.2 and not tvOS 9.3.

Before this change, the incorrect mapping could cause excessive or missing warnings for code that specifies availability for iOS, but not for tvOS/watchOS.

rdar://81491680

Diff Detail

Event Timeline

egorzhdan created this revision.Jan 7 2022, 10:14 AM
egorzhdan requested review of this revision.Jan 7 2022, 10:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2022, 10:14 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
egorzhdan updated this revision to Diff 398192.Jan 7 2022, 10:38 AM

Remove accidental change

arphaman accepted this revision.Jan 11 2022, 11:56 AM

LGTM with one comment. This is great, thanks!

clang/test/Sema/attr-availability-tvos.c
66

Can you add an #else test case that shows the old diagnostic saying that it's deprecated in tvOS 9.3?

This revision is now accepted and ready to land.Jan 11 2022, 11:56 AM
egorzhdan updated this revision to Diff 399327.Jan 12 2022, 7:38 AM

Add a test for a diagnostic without VersionMap & fix clang-format warning

egorzhdan marked an inline comment as done.Jan 12 2022, 7:39 AM