This Patch gives ExtractAPI the ability to emit correct availability information for symbols marked as unavailable on a specific platform ( PR#60954 )
Nice! glad to see this getting fixed. You should add a lit test to ensure we don't regress this behavior in the future.
I don't think this change here is necessary.
Yes you can use git-clang-format, instructions here for setup: https://offlinemark.com/2021/04/02/surgical-formatting-with-git-clang-format/
I see a test checking for availability attribute already exists ( clang/test/ExtractAPI/availability.c ) would it be better if I update it with another function having a platform specific unavailability attribute or should I create a new test file ?
LGTM, It's worth noting that if the user specifies that an API is unavailable in a later redeclaration, this will be ignored. For example if I add a line to the test void e(void) __attribute__((availability(macos, unavailable))); it will be ignored. Up to you whether you want to fix it now or at a later date.