//===--- NSDateFormatterCheck.cpp - clang-tidy ----------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "NSDateFormatterCheck.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" usingnamespaceclang::ast_matchers; namespace clang::tidy::objc { void NSDateFormatterCheck::registerMatchers(MatchFinder *Finder) { … } static char ValidDatePatternChars[] = …; // Checks if the string pattern used as a date format specifier is valid. // A string pattern is valid if all the letters(a-z, A-Z) in it belong to the // set of reserved characters. See: // https://www.unicode.org/reports/tr35/tr35.html#Invalid_Patterns bool isValidDatePattern(StringRef Pattern) { … } // Checks if the string pattern used as a date format specifier contains // any incorrect pattern and reports it as a warning. // See: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns void NSDateFormatterCheck::check(const MatchFinder::MatchResult &Result) { … } } // namespace clang::tidy::objc