From 6a61922239de8018239eef23328dba457874064c Mon Sep 17 00:00:00 2001 From: Anton Yartsev Date: Mon, 17 Feb 2014 18:25:34 +0000 Subject: [analyzer] Improved checker naming in CFG dump. This implements FIXME from Checker.cpp (FIXME: We want to return the package + name of the checker here.) and replaces hardcoded checker names with the new ones obtained via getCheckName().getName(). llvm-svn: 201525 --- clang/lib/StaticAnalyzer/Core/Checker.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/Checker.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/Checker.cpp b/clang/lib/StaticAnalyzer/Core/Checker.cpp index e2b2a19e964..1a3965acaf4 100644 --- a/clang/lib/StaticAnalyzer/Core/Checker.cpp +++ b/clang/lib/StaticAnalyzer/Core/Checker.cpp @@ -18,12 +18,25 @@ using namespace clang; using namespace ento; StringRef CheckerBase::getTagDescription() const { - // FIXME: We want to return the package + name of the checker here. - return "A Checker"; + return getCheckName().getName(); } CheckName CheckerBase::getCheckName() const { return Name; } +CheckerProgramPointTag::CheckerProgramPointTag(StringRef CheckerName, + StringRef Msg) + : SimpleProgramPointTag(CheckerName, Msg) {} + +CheckerProgramPointTag::CheckerProgramPointTag(const CheckerBase *Checker, + StringRef Msg) + : SimpleProgramPointTag(Checker->getCheckName().getName(), Msg) {} + +raw_ostream& clang::ento::operator<<(raw_ostream &Out, + const CheckerBase &Checker) { + Out << Checker.getCheckName().getName(); + return Out; +} + void Checker