This is an archive of the discontinued LLVM Phabricator instance.

[Format/ObjC] Support NS_ASSUME_NONNULL_BEGIN and FOUNDATION_EXPORT in ObjC language guesser
ClosedPublic

Authored by benhamilton on May 26 2023, 12:01 PM.

Details

Summary

This adds to the ObjC language guesser a few more common macros used
in ObjC headers. These can help distinguish ObjC headers which
otherwise lack ObjC types from C++ headers.

Contributed by danblakemore.

Tested: New tests included. Ran unit tests with:

% cmake -S llvm -B build -G Ninja && \
  ninja -C build FormatTests && \
  ./build/tools/clang/unittests/Format/FormatTests --gtest_filter="*FormatTestObjC*"

(snip)
[----------] 24 tests from FormatTestObjC (265 ms total)

[----------] Global test environment tear-down
[==========] 26 tests from 2 test suites ran. (270 ms total)
[  PASSED  ] 26 tests.

Diff Detail

Event Timeline

benhamilton created this revision.May 26 2023, 12:01 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptMay 26 2023, 12:02 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benhamilton requested review of this revision.May 26 2023, 12:02 PM
benhamilton edited the summary of this revision. (Show Details)May 26 2023, 12:02 PM

Fix auto-complete-o.

benhamilton updated this revision to Diff 526154.EditedMay 26 2023, 12:06 PM

Add FOUNDATION_EXPORT alias for FOUNDATION_EXTERN (Apple #defines the former to the latter).

This revision is now accepted and ready to land.May 26 2023, 4:30 PM