This class provides an interface through which checkers can create individual bug reports.
More...
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
This class provides an interface through which checkers can create individual bug reports.
Definition at line 119 of file BugReporter.h.
◆ Kind
◆ BugReport() [1/2]
clang::ento::BugReport::BugReport |
( |
Kind |
kind, |
|
|
const BugType & |
bt, |
|
|
StringRef |
desc |
|
) |
| |
|
inlineprotected |
◆ BugReport() [2/2]
clang::ento::BugReport::BugReport |
( |
Kind |
K, |
|
|
const BugType & |
BT, |
|
|
StringRef |
ShortDescription, |
|
|
StringRef |
Description |
|
) |
| |
|
inlineprotected |
◆ ~BugReport()
virtual clang::ento::BugReport::~BugReport |
( |
| ) |
|
|
virtualdefault |
◆ addFixItHint()
void clang::ento::BugReport::addFixItHint |
( |
const FixItHint & |
F | ) |
|
|
inline |
Add a fix-it hint to the bug report.
Fix-it hints are the suggested edits to the code that would resolve the problem explained by the bug report. Fix-it hints should be as conservative as possible because it is not uncommon for the user to blindly apply all fixits to their project. Note that it is very hard to produce a good fix-it hint for most path-sensitive warnings.
Definition at line 240 of file BugReporter.h.
◆ addNote()
Add new item to the list of additional notes that need to be attached to this report.
If the report is path-sensitive, these notes will not be displayed as part of the execution path explanation, but will be displayed separately. Use bug visitors if you need to add an extra path note.
Definition at line 201 of file BugReporter.h.
References P.
◆ addRange()
Add a range to a bug report.
Ranges are used to highlight regions of interest in the source code. They should be at the same source code line as the BugReport location. By default, the source range of the statement corresponding to the error node will be used; add a single invalid range to specify absence of ranges.
Definition at line 222 of file BugReporter.h.
References clang::SourceRange::isValid().
◆ getBugType()
const BugType& clang::ento::BugReport::getBugType |
( |
| ) |
const |
|
inline |
◆ getDeclWithIssue()
virtual const Decl* clang::ento::BugReport::getDeclWithIssue |
( |
| ) |
const |
|
pure virtual |
◆ getDescription()
StringRef clang::ento::BugReport::getDescription |
( |
| ) |
const |
|
inline |
A verbose warning message that is appropriate for displaying next to the source code that introduces the problem.
The description should be at least a full sentence starting with a capital letter. The period at the end of the warning is traditionally omitted. If the description consists of multiple sentences, periods between the sentences are encouraged, but the period at the end of the description is still omitted.
Definition at line 157 of file BugReporter.h.
◆ getFixits()
◆ getKind()
Kind clang::ento::BugReport::getKind |
( |
| ) |
const |
|
inline |
◆ getLocation()
◆ getNotes()
◆ getRanges()
◆ getShortDescription()
StringRef clang::ento::BugReport::getShortDescription |
( |
bool |
UseFallback = true | ) |
const |
|
inline |
A short general warning message that is appropriate for displaying in the list of all reported bugs.
It should describe what kind of bug is found but does not need to try to go into details of that specific bug. Grammatical conventions of getDescription() apply here as well.
Definition at line 163 of file BugReporter.h.
◆ getUniqueingDecl()
virtual const Decl* clang::ento::BugReport::getUniqueingDecl |
( |
| ) |
const |
|
pure virtual |
◆ getUniqueingLocation()
Get the location on which the report should be uniqued.
Two warnings are considered to be equivalent whenever they have the same bug types, descriptions, and uniqueing locations. Out of a class of equivalent warnings only one gets displayed to the user. For most warnings the uniqueing location coincides with their location, but sometimes it makes sense to use different locations. For example, a leak checker can place the warning at the location where the last reference to the leaking resource is dropped but at the same time unique the warning by where that resource is acquired (allocated).
Implemented in clang::ento::PathSensitiveBugReport, and clang::ento::BasicBugReport.
◆ Profile()
virtual void clang::ento::BugReport::Profile |
( |
llvm::FoldingSetNodeID & |
hash | ) |
const |
|
pure virtual |
◆ BugReportEquivClass
◆ BugReporter
◆ BT
const BugType& clang::ento::BugReport::BT |
|
protected |
◆ Description
std::string clang::ento::BugReport::Description |
|
protected |
◆ Fixits
Kind clang::ento::BugReport::K |
|
protected |
◆ Notes
◆ Ranges
◆ ShortDescription
std::string clang::ento::BugReport::ShortDescription |
|
protected |
The documentation for this class was generated from the following file: