htl created this revision. Herald added a project: clang. Repository: rG LLVM Github Monorepo
https://reviews.llvm.org/D59318 Files: clang-tools-extra/clang-tidy/ClangTidy.cpp clang-tools-extra/clang-tidy/ClangTidy.h Index: clang-tools-extra/clang-tidy/ClangTidy.h =================================================================== --- clang-tools-extra/clang-tidy/ClangTidy.h +++ clang-tools-extra/clang-tidy/ClangTidy.h @@ -165,6 +165,14 @@ DiagnosticBuilder diag(SourceLocation Loc, StringRef Description, DiagnosticIDs::Level Level = DiagnosticIDs::Warning); + /// \brief Add a diagnostic with a user-specified name. + /// + /// Similar to the method above, but allows user to specify a DiagnosticName + /// of the Diagnostic created. + DiagnosticBuilder diag(StringRef DiagnosticName, SourceLocation Loc, + StringRef Description, + DiagnosticIDs::Level Level = DiagnosticIDs::Warning); + /// \brief Should store all options supported by this check with their /// current values or default values for options that haven't been overridden. /// Index: clang-tools-extra/clang-tidy/ClangTidy.cpp =================================================================== --- clang-tools-extra/clang-tidy/ClangTidy.cpp +++ clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -439,6 +439,13 @@ return Context->diag(CheckName, Loc, Message, Level); } +DiagnosticBuilder ClangTidyCheck::diag(StringRef DiagnosticName, + SourceLocation Loc, + StringRef Description, + DiagnosticIDs::Level Level) { + return Context->diag(DiagnosticName, Loc, Description, Level); +} + void ClangTidyCheck::run(const ast_matchers::MatchFinder::MatchResult &Result) { // For historical reasons, checks don't implement the MatchFinder run() // callback directly. We keep the run()/check() distinction to avoid interface
Index: clang-tools-extra/clang-tidy/ClangTidy.h =================================================================== --- clang-tools-extra/clang-tidy/ClangTidy.h +++ clang-tools-extra/clang-tidy/ClangTidy.h @@ -165,6 +165,14 @@ DiagnosticBuilder diag(SourceLocation Loc, StringRef Description, DiagnosticIDs::Level Level = DiagnosticIDs::Warning); + /// \brief Add a diagnostic with a user-specified name. + /// + /// Similar to the method above, but allows user to specify a DiagnosticName + /// of the Diagnostic created. + DiagnosticBuilder diag(StringRef DiagnosticName, SourceLocation Loc, + StringRef Description, + DiagnosticIDs::Level Level = DiagnosticIDs::Warning); + /// \brief Should store all options supported by this check with their /// current values or default values for options that haven't been overridden. /// Index: clang-tools-extra/clang-tidy/ClangTidy.cpp =================================================================== --- clang-tools-extra/clang-tidy/ClangTidy.cpp +++ clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -439,6 +439,13 @@ return Context->diag(CheckName, Loc, Message, Level); } +DiagnosticBuilder ClangTidyCheck::diag(StringRef DiagnosticName, + SourceLocation Loc, + StringRef Description, + DiagnosticIDs::Level Level) { + return Context->diag(DiagnosticName, Loc, Description, Level); +} + void ClangTidyCheck::run(const ast_matchers::MatchFinder::MatchResult &Result) { // For historical reasons, checks don't implement the MatchFinder run() // callback directly. We keep the run()/check() distinction to avoid interface
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits