This Patch gives ExtractAPI the ability to emit correct availability information for symbols marked as unavailable on a specific platform ( PR#60954 )
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | ||
---|---|---|
550 | These changes seems to have added by clang-format. |
Nice! glad to see this getting fixed. You should add a lit test to ensure we don't regress this behavior in the future.
clang/include/clang/ExtractAPI/AvailabilityInfo.h | ||
---|---|---|
48 | I don't think this change here is necessary. | |
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp | ||
550 | 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 ?
Yes I think updating that test with another API that has a platform specific unavailability attribute is the best way to do this.
Add test to check platform specific unavailability
The update also remove the useless changes that were introduced by
using clang format on the entire file instead of current commit.
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.
I don't think this change here is necessary.