clang  6.0.0svn
Public Types | Public Member Functions | Protected Member Functions | List of all members
clang::ento::BugReporter Class Reference

BugReporter is a utility class for generating PathDiagnostics for analysis. More...

#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"

Inheritance diagram for clang::ento::BugReporter:
Inheritance graph
[legend]

Public Types

enum  Kind { BaseBRKind, GRBugReporterKind }
 
typedef BugTypesTy::iterator iterator
 Iterator over the set of BugTypes tracked by the BugReporter. More...
 
typedef llvm::FoldingSet< BugReportEquivClass >::iterator EQClasses_iterator
 Iterator over the set of BugReports tracked by the BugReporter. More...
 

Public Member Functions

 BugReporter (BugReporterData &d)
 
virtual ~BugReporter ()
 
void FlushReports ()
 Generate and flush diagnostics for all bug reports. More...
 
Kind getKind () const
 
DiagnosticsEnginegetDiagnostic ()
 
ArrayRef< PathDiagnosticConsumer * > getPathDiagnosticConsumers ()
 
iterator begin ()
 
iterator end ()
 
EQClasses_iterator EQClasses_begin ()
 
EQClasses_iterator EQClasses_end ()
 
ASTContextgetContext ()
 
SourceManagergetSourceManager ()
 
AnalyzerOptionsgetAnalyzerOptions ()
 
virtual bool generatePathDiagnostic (PathDiagnostic &pathDiagnostic, PathDiagnosticConsumer &PC, ArrayRef< BugReport *> &bugReports)
 
bool RemoveUnneededCalls (PathPieces &pieces, BugReport *R)
 
void Register (BugType *BT)
 
void emitReport (std::unique_ptr< BugReport > R)
 Add the given report to the set of reports tracked by BugReporter. More...
 
void EmitBasicReport (const Decl *DeclWithIssue, const CheckerBase *Checker, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=None)
 
void EmitBasicReport (const Decl *DeclWithIssue, CheckName CheckName, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=None)
 

Protected Member Functions

 BugReporter (BugReporterData &d, Kind k)
 

Detailed Description

BugReporter is a utility class for generating PathDiagnostics for analysis.

It collects the BugReports and BugTypes and knows how to generate and flush the corresponding diagnostics.

Definition at line 403 of file BugReporter.h.

Member Typedef Documentation

◆ EQClasses_iterator

Iterator over the set of BugReports tracked by the BugReporter.

Definition at line 457 of file BugReporter.h.

◆ iterator

typedef BugTypesTy::iterator clang::ento::BugReporter::iterator

Iterator over the set of BugTypes tracked by the BugReporter.

Definition at line 452 of file BugReporter.h.

Member Enumeration Documentation

◆ Kind

Enumerator
BaseBRKind 
GRBugReporterKind 

Definition at line 405 of file BugReporter.h.

Constructor & Destructor Documentation

◆ BugReporter() [1/2]

clang::ento::BugReporter::BugReporter ( BugReporterData d,
Kind  k 
)
inlineprotected

Definition at line 430 of file BugReporter.h.

◆ BugReporter() [2/2]

clang::ento::BugReporter::BugReporter ( BugReporterData d)
inline

Definition at line 434 of file BugReporter.h.

◆ ~BugReporter()

BugReporter::~BugReporter ( )
virtual

Definition at line 2762 of file BugReporter.cpp.

Member Function Documentation

◆ begin()

iterator clang::ento::BugReporter::begin ( )
inline

Definition at line 453 of file BugReporter.h.

◆ EmitBasicReport() [1/2]

void BugReporter::EmitBasicReport ( const Decl DeclWithIssue,
const CheckerBase Checker,
StringRef  BugName,
StringRef  BugCategory,
StringRef  BugStr,
PathDiagnosticLocation  Loc,
ArrayRef< SourceRange Ranges = None 
)

◆ EmitBasicReport() [2/2]

void BugReporter::EmitBasicReport ( const Decl DeclWithIssue,
CheckName  CheckName,
StringRef  BugName,
StringRef  BugCategory,
StringRef  BugStr,
PathDiagnosticLocation  Loc,
ArrayRef< SourceRange Ranges = None 
)

Definition at line 3587 of file BugReporter.cpp.

◆ emitReport()

void BugReporter::emitReport ( std::unique_ptr< BugReport R)

Add the given report to the set of reports tracked by BugReporter.

The reports are usually generated by the checkers. Further, they are folded based on the profile value, which is done to coalesce similar reports.

Definition at line 3242 of file BugReporter.cpp.

Referenced by clang::ento::CheckerContext::emitReport(), getArgumentValueString(), clang::ento::mpi::MPIBugReporter::reportDoubleNonblocking(), clang::ento::mpi::MPIBugReporter::reportMissingWait(), and clang::ento::mpi::MPIBugReporter::reportUnmatchedWait().

◆ end()

iterator clang::ento::BugReporter::end ( )
inline

Definition at line 454 of file BugReporter.h.

◆ EQClasses_begin()

EQClasses_iterator clang::ento::BugReporter::EQClasses_begin ( )
inline

Definition at line 458 of file BugReporter.h.

◆ EQClasses_end()

EQClasses_iterator clang::ento::BugReporter::EQClasses_end ( )
inline

Definition at line 459 of file BugReporter.h.

◆ FlushReports()

void BugReporter::FlushReports ( )

Generate and flush diagnostics for all bug reports.

Definition at line 2773 of file BugReporter.cpp.

Referenced by clang::ento::ExprEngine::~ExprEngine().

◆ generatePathDiagnostic()

virtual bool clang::ento::BugReporter::generatePathDiagnostic ( PathDiagnostic pathDiagnostic,
PathDiagnosticConsumer PC,
ArrayRef< BugReport *> &  bugReports 
)
inlinevirtual

◆ getAnalyzerOptions()

AnalyzerOptions& clang::ento::BugReporter::getAnalyzerOptions ( )
inline

Definition at line 465 of file BugReporter.h.

References clang::ento::BugReporterData::getAnalyzerOptions().

◆ getContext()

ASTContext& clang::ento::BugReporter::getContext ( )
inline

◆ getDiagnostic()

DiagnosticsEngine& clang::ento::BugReporter::getDiagnostic ( )
inline

Definition at line 443 of file BugReporter.h.

References clang::ento::BugReporterData::getDiagnostic().

◆ getKind()

Kind clang::ento::BugReporter::getKind ( ) const
inline

Definition at line 441 of file BugReporter.h.

Referenced by clang::ento::GRBugReporter::classof().

◆ getPathDiagnosticConsumers()

ArrayRef<PathDiagnosticConsumer*> clang::ento::BugReporter::getPathDiagnosticConsumers ( )
inline

◆ getSourceManager()

SourceManager& clang::ento::BugReporter::getSourceManager ( )
inline

◆ Register()

void BugReporter::Register ( BugType BT)

Definition at line 3238 of file BugReporter.cpp.

◆ RemoveUnneededCalls()

bool clang::ento::BugReporter::RemoveUnneededCalls ( PathPieces pieces,
BugReport R 
)

The documentation for this class was generated from the following files: