2011-08-13 07:04:46 +08: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 10:23:28 +08:00
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
|
2011-08-13 07:04:46 +08:00
|
|
|
#include "clang/StaticAnalyzer/Core/Checker.h"
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
using namespace ento;
|
|
|
|
|
2018-10-20 08:29:24 +08:00
|
|
|
int ImplicitNullDerefEvent::Tag;
|
|
|
|
|
2011-08-13 07:04:46 +08:00
|
|
|
StringRef CheckerBase::getTagDescription() const {
|
2014-02-18 02:25:34 +08:00
|
|
|
return getCheckName().getName();
|
2011-08-13 07:04:46 +08:00
|
|
|
}
|
2011-12-20 10:48:34 +08:00
|
|
|
|
2014-02-12 05:49:21 +08:00
|
|
|
CheckName CheckerBase::getCheckName() const { return Name; }
|
|
|
|
|
2015-09-08 11:50:52 +08:00
|
|
|
CheckerProgramPointTag::CheckerProgramPointTag(StringRef CheckerName,
|
2014-02-18 02:25:34 +08: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;
|
|
|
|
}
|