2011-08-13 07:04:46 +08:00
|
|
|
//== Checker.cpp - Registration mechanism for checkers -----------*- C++ -*--=//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2011-08-13 07:04:46 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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;
|
|
|
|
}
|