[Format/ObjC] Support NS_ERROR_ENUM in ObjC language guesser
authorBen Hamilton <benhamilton@google.com>
Tue, 4 Apr 2023 21:27:42 +0000 (15:27 -0600)
committerBen Hamilton <benhamilton@google.com>
Fri, 7 Apr 2023 22:10:52 +0000 (16:10 -0600)
commit00ea6798959d358aff9d7ef0907bbe241be7f7a4
treea057cf8b522082e9fc2c172652119945e140c55c
parent0f9bfe0a02ffff077a1a98065069b52744e31723
[Format/ObjC] Support NS_ERROR_ENUM in ObjC language guesser

Apple added a new NS_ERROR_ENUM macro to help define enums for
NSError codes.

This updates libformat's Objective-C language-guessing heuristic
to detect the new macro as well as related NSError types.

Tested: New tests added.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D147577
clang/lib/Format/Format.cpp
clang/lib/Format/FormatToken.h
clang/unittests/Format/FormatTestObjC.cpp