clang  10.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

using EQClasses_iterator = llvm::FoldingSet< BugReportEquivClass >::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...
 
ArrayRef< PathDiagnosticConsumer * > getPathDiagnosticConsumers ()
 
EQClasses_iterator EQClasses_begin ()
 
EQClasses_iterator EQClasses_end ()
 
ASTContextgetContext ()
 
const SourceManagergetSourceManager ()
 
const AnalyzerOptionsgetAnalyzerOptions ()
 
virtual 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, ArrayRef< FixItHint > Fixits=None)
 
void EmitBasicReport (const Decl *DeclWithIssue, CheckerNameRef CheckerName, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=None, ArrayRef< FixItHint > Fixits=None)
 

Protected Member Functions

virtual std::unique_ptr< DiagnosticForConsumerMapTygenerateDiagnosticForConsumerMap (BugReport *exampleReport, ArrayRef< PathDiagnosticConsumer *> consumers, ArrayRef< BugReport *> bugReports)
 Generate the diagnostics for the given bug report. More...
 

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.

The base class is used for generating path-insensitive

Definition at line 576 of file BugReporter.h.

Member Typedef Documentation

◆ EQClasses_iterator

Iterator over the set of BugReports tracked by the BugReporter.

Definition at line 601 of file BugReporter.h.

Constructor & Destructor Documentation

◆ BugReporter()

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

Definition at line 590 of file BugReporter.h.

◆ ~BugReporter()

BugReporter::~BugReporter ( )
virtual

Definition at line 2392 of file BugReporter.cpp.

Member Function Documentation

◆ EmitBasicReport() [1/2]

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

◆ EmitBasicReport() [2/2]

void clang::ento::BugReporter::EmitBasicReport ( const Decl DeclWithIssue,
CheckerNameRef  CheckerName,
StringRef  BugName,
StringRef  BugCategory,
StringRef  BugStr,
PathDiagnosticLocation  Loc,
ArrayRef< SourceRange Ranges = None,
ArrayRef< FixItHint Fixits = None 
)

◆ emitReport()

virtual void clang::ento::BugReporter::emitReport ( std::unique_ptr< BugReport R)
virtual

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.

Reimplemented in clang::ento::PathSensitiveBugReporter.

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

◆ EQClasses_begin()

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

Definition at line 602 of file BugReporter.h.

◆ EQClasses_end()

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

Definition at line 603 of file BugReporter.h.

◆ FlushReports()

void BugReporter::FlushReports ( )

◆ generateDiagnosticForConsumerMap()

virtual std::unique_ptr<DiagnosticForConsumerMapTy> clang::ento::BugReporter::generateDiagnosticForConsumerMap ( BugReport exampleReport,
ArrayRef< PathDiagnosticConsumer *>  consumers,
ArrayRef< BugReport *>  bugReports 
)
protectedvirtual

Generate the diagnostics for the given bug report.

Referenced by CompactMacroExpandedPieces().

◆ getAnalyzerOptions()

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

◆ getContext()

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

◆ getPathDiagnosticConsumers()

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

◆ getSourceManager()

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

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