This is an archive of the discontinued LLVM Phabricator instance.

[libclang][ObjC] Inherit availability attribute from containing decls or interface decls
ClosedPublic

Authored by ahatanak on Jul 11 2022, 10:52 AM.

Details

Summary

This patch teaches getCursorPlatformAvailabilityForDecl to look for availability attributes on the containing decls or interface decls if the current decl doesn't have any availability attributes.

Diff Detail

Event Timeline

ahatanak created this revision.Jul 11 2022, 10:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 10:52 AM
ahatanak requested review of this revision.Jul 11 2022, 10:52 AM
benlangmuir added inline comments.Jul 11 2022, 3:34 PM
clang/tools/libclang/CIndex.cpp
8271

So this goes Impl -> Class, and CategoryImpl -> Category. Should it also do Category -> Class?

ahatanak updated this revision to Diff 445130.Jul 15 2022, 2:20 PM
ahatanak marked an inline comment as done.

If a category decl doesn't have availability, inherit it from the class decl.

benlangmuir accepted this revision.Jul 15 2022, 2:33 PM

LGTM, thanks

This revision is now accepted and ready to land.Jul 15 2022, 2:33 PM