2011-08-12 23:04:46 +00:00
|
|
|
//== Checker.cpp - Registration mechanism for checkers -----------*- C++ -*--=//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines Checker, used to create and register checkers.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-01-31 02:23:28 +00:00
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
|
2011-08-12 23:04:46 +00:00
|
|
|
#include "clang/StaticAnalyzer/Core/Checker.h"
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
using namespace ento;
|
|
|
|
|
|
|
|
StringRef CheckerBase::getTagDescription() const {
|
2014-02-17 18:25:34 +00:00
|
|
|
return getCheckName().getName();
|
2011-08-12 23:04:46 +00:00
|
|
|
}
|
2011-12-20 02:48:34 +00:00
|
|
|
|
2014-02-11 21:49:21 +00:00
|
|
|
CheckName CheckerBase::getCheckName() const { return Name; }
|
|
|
|
|
2015-09-08 03:50:52 +00:00
|
|
|
CheckerProgramPointTag::CheckerProgramPointTag(StringRef CheckerName,
|
2014-02-17 18:25:34 +00:00
|
|
|
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;
|
|
|
|
}
|