This is an archive of the discontinued LLVM Phabricator instance.

Support Swift in platform availability attribute
ClosedPublic

Authored by michaelwu on Aug 5 2018, 4:06 PM.

Details

Summary

This adds support for Swift platform availability attributes. It's largely a port of the changes made to https://github.com/apple/swift-clang/ for Swift availability attributes. Specifically, https://github.com/apple/swift-clang/commit/84b5a21c31cb5b0d7d958a478bc01964939b6952 and https://github.com/apple/swift-clang/commit/e5b87f265aede41c8381094bbf54e2715c8293b0 . The implementation of attribute_availability_swift is a little different and additional tests in test/Index/availability.c were added.

Diff Detail

Repository
rC Clang

Event Timeline

michaelwu created this revision.Aug 5 2018, 4:06 PM

Review ping

aaron.ballman accepted this revision.Nov 1 2018, 8:18 AM
aaron.ballman added a subscriber: aaron.ballman.

LGTM aside from a few small nits.

lib/Parse/ParseDecl.cpp
1005

You can use Platform->Ident->isStr("swift") here instead.

1007

Might as well switch the logic around to using isValid() instead.

lib/Sema/SemaDeclAttr.cpp
2413

II->isStr() here as well.

This revision is now accepted and ready to land.Nov 1 2018, 8:18 AM
michaelwu updated this revision to Diff 173607.Nov 11 2018, 6:37 PM

Thanks for the review! All requested changes have been made, and I also had to fix a test due to D50214

michaelwu marked 3 inline comments as done.Nov 11 2018, 6:38 PM
This revision was automatically updated to reflect the committed changes.