Wizard created this revision.
Herald added subscribers: cfe-commits, klimek.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D46374
Files:
clang-tidy/objc/PropertyDeclarationCheck.cpp
test/clang-tidy/objc-property-declaration.m
Index: test/clang-tidy/objc-property-declaration.m
===================================================================
--- test/clang-tidy/objc-property-declaration.m
+++ test/clang-tidy/objc-property-declaration.m
@@ -21,6 +21,7 @@
@property(assign, nonatomic) int enable2GBackgroundFetch;
@property(assign, nonatomic) int shouldUseCFPreferences;
@property(assign, nonatomic) int enableGLAcceleration;
+@property(assign, nonatomic) int ID;
@end
@interface Foo (Bar)
Index: clang-tidy/objc/PropertyDeclarationCheck.cpp
===================================================================
--- clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -39,75 +39,14 @@
///
/// Keep this list sorted.
constexpr llvm::StringLiteral DefaultSpecialAcronyms[] = {
- "[2-9]G",
- "ACL",
- "API",
- "ARGB",
- "ASCII",
- "BGRA",
- "CA",
- "CF",
- "CG",
- "CI",
- "CV",
- "CMYK",
- "DNS",
- "FPS",
- "FTP",
- "GIF",
- "GL",
- "GPS",
- "GUID",
- "HD",
- "HDR",
- "HTML",
- "HTTP",
- "HTTPS",
- "HUD",
- "ID",
- "JPG",
- "JS",
- "LAN",
- "LZW",
- "MDNS",
- "MIDI",
- "NS",
- "OS",
- "PDF",
- "PIN",
- "PNG",
- "POI",
- "PSTN",
- "PTR",
- "QA",
- "QOS",
- "RGB",
- "RGBA",
- "RGBX",
- "ROM",
- "RPC",
- "RTF",
- "RTL",
- "SC",
- "SDK",
- "SSO",
- "TCP",
- "TIFF",
- "TTS",
- "UI",
- "URI",
- "URL",
- "UUID",
- "VC",
- "VOIP",
- "VPN",
- "VR",
- "W",
- "WAN",
- "X",
- "XML",
- "Y",
- "Z",
+ "[2-9]G", "ACL", "API", "ARGB", "ASCII", "BGRA", "CA", "CF", "CG",
+ "CI", "CV", "CMYK", "DNS", "FPS", "FTP", "GIF", "GL", "GPS",
+ "GUID", "HD", "HDR", "HTML", "HTTP", "HTTPS", "HUD", "ID", "JPG",
+ "JS", "LAN", "LZW", "MDNS", "MIDI", "NS", "OS", "PDF", "PIN",
+ "PNG", "POI", "PSTN", "PTR", "QA", "QOS", "RGB", "RGBA", "RGBX",
+ "ROM", "RPC", "RTF", "RTL", "SC", "SDK", "SSO", "TCP", "TIFF",
+ "TTS", "UI", "URI", "URL", "UUID", "VC", "VOIP", "VPN", "VR",
+ "W", "WAN", "X", "XML", "Y", "Z",
};
/// For now we will only fix 'CamelCase' or 'abc_CamelCase' property to
@@ -217,6 +156,12 @@
assert(MatchedDecl->getName().size() > 0);
auto *DeclContext = MatchedDecl->getDeclContext();
auto *CategoryDecl = llvm::dyn_cast<ObjCCategoryDecl>(DeclContext);
+ if (std::any_of(EscapedAcronyms.begin(), EscapedAcronyms.end(),
+ [MatchedDecl](std::string const &s) {
+ return s == MatchedDecl->getName();
+ })) {
+ return;
+ }
if (CategoryDecl != nullptr &&
hasCategoryPropertyPrefix(MatchedDecl->getName())) {
if (!prefixedPropertyNameValid(MatchedDecl->getName(), EscapedAcronyms) ||
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits