From 072bce7f6ce1196355a3f906bfea8465f4fd876d Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 13 Jan 2014 10:50:51 +0000 Subject: Add the check name to the clang-tidy diagnostic output. Summary: Pass check names all the way from ClangTidyModule through ClangTidyCheck and ClangTidyContext to ClangTidyError, and output it in handleErrors. This allows to find mis-behaving check and disable it easily. Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2534 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@199094 91177308-0d34-0410-b5e6-96231b3b80d8 --- clang-tidy/ClangTidyModule.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'clang-tidy/ClangTidyModule.cpp') diff --git a/clang-tidy/ClangTidyModule.cpp b/clang-tidy/ClangTidyModule.cpp index dc3a11d0..87ab2be3 100644 --- a/clang-tidy/ClangTidyModule.cpp +++ b/clang-tidy/ClangTidyModule.cpp @@ -32,8 +32,11 @@ void ClangTidyCheckFactories::createChecks( ChecksFilter &Filter, SmallVectorImpl &Checks) { for (FactoryMap::iterator I = Factories.begin(), E = Factories.end(); I != E; ++I) { - if (Filter.IsCheckEnabled(I->first)) - Checks.push_back(I->second->createCheck()); + if (Filter.IsCheckEnabled(I->first)) { + ClangTidyCheck *Check = I->second->createCheck(); + Check->setName(I->first); + Checks.push_back(Check); + } } } -- cgit v1.2.3