1 //== Checker.cpp - Registration mechanism for checkers -----------*- C++ -*--=//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines Checker, used to create and register checkers.
11 //===----------------------------------------------------------------------===//
13 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
14 #include "clang/StaticAnalyzer/Core/Checker.h"
16 using namespace clang
;
19 int ImplicitNullDerefEvent::Tag
;
21 StringRef
CheckerBase::getTagDescription() const {
22 return getCheckerName().getName();
25 CheckerNameRef
CheckerBase::getCheckerName() const { return Name
; }
27 CheckerProgramPointTag::CheckerProgramPointTag(StringRef CheckerName
,
29 : SimpleProgramPointTag(CheckerName
, Msg
) {}
31 CheckerProgramPointTag::CheckerProgramPointTag(const CheckerBase
*Checker
,
33 : SimpleProgramPointTag(Checker
->getCheckerName().getName(), Msg
) {}
35 raw_ostream
& clang::ento::operator<<(raw_ostream
&Out
,
36 const CheckerBase
&Checker
) {
37 Out
<< Checker
.getCheckerName().getName();