clang  14.0.0git
Checker.cpp
Go to the documentation of this file.
1 //== Checker.cpp - Registration mechanism for checkers -----------*- C++ -*--=//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines Checker, used to create and register checkers.
10 //
11 //===----------------------------------------------------------------------===//
12 
15 
16 using namespace clang;
17 using namespace ento;
18 
20 
21 StringRef CheckerBase::getTagDescription() const {
22  return getCheckerName().getName();
23 }
24 
26 
28  StringRef Msg)
29  : SimpleProgramPointTag(CheckerName, Msg) {}
30 
32  StringRef Msg)
33  : SimpleProgramPointTag(Checker->getCheckerName().getName(), Msg) {}
34 
35 raw_ostream& clang::ento::operator<<(raw_ostream &Out,
36  const CheckerBase &Checker) {
37  Out << Checker.getCheckerName().getName();
38  return Out;
39 }
clang::ento::CheckerProgramPointTag::CheckerProgramPointTag
CheckerProgramPointTag(StringRef CheckerName, StringRef Msg)
Definition: Checker.cpp:27
clang::ento::CheckerBase::getCheckerName
CheckerNameRef getCheckerName() const
Definition: Checker.cpp:25
clang::ento::CheckerBase::getTagDescription
StringRef getTagDescription() const override
Definition: Checker.cpp:21
clang::ento::CheckerNameRef
This wrapper is used to ensure that only StringRefs originating from the CheckerRegistry are used as ...
Definition: CheckerManager.h:107
getName
static std::string getName(const CallEvent &Call)
Definition: ReturnValueChecker.cpp:60
clang::SimpleProgramPointTag
Definition: ProgramPoint.h:52
clang::ento::CheckerBase
Definition: Checker.h:492
ProgramState.h
Checker.h
clang::ento::ImplicitNullDerefEvent::Tag
static int Tag
Definition: Checker.h:563
clang::ento::CheckerNameRef::getName
StringRef getName() const
Definition: CheckerManager.h:117
clang::ento::operator<<
raw_ostream & operator<<(raw_ostream &Out, const CheckerBase &Checker)
Dump checker name to stream.
Definition: Checker.cpp:35
clang
Definition: CalledOnceCheck.h:17
clang::ento::Checker
Definition: Checker.h:517