clang 20.0.0git
Public Member Functions | List of all members
clang::ento::PathSensitiveBugReporter Class Referencefinal

GRBugReporter is used for generating path-sensitive reports. More...

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

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

Public Member Functions

 PathSensitiveBugReporter (BugReporterData &d, ExprEngine &eng)
 
const ExplodedGraphgetGraph () const
 getGraph - Get the exploded graph created by the analysis engine for the analyzed method or function.
 
ProgramStateManagergetStateManager () const
 getStateManager - Return the state manager used by the analysis engine.
 
std::unique_ptr< DiagnosticForConsumerMapTygeneratePathDiagnostics (ArrayRef< PathDiagnosticConsumer * > consumers, ArrayRef< PathSensitiveBugReport * > &bugReports)
 bugReports A set of bug reports within a single equivalence class
 
void emitReport (std::unique_ptr< BugReport > R) override
 Add the given report to the set of reports tracked by BugReporter.
 
- Public Member Functions inherited from clang::ento::BugReporter
 BugReporter (BugReporterData &d)
 
virtual ~BugReporter ()
 
void FlushReports ()
 Generate and flush diagnostics for all bug reports.
 
ArrayRef< PathDiagnosticConsumer * > getPathDiagnosticConsumers ()
 
llvm::iterator_range< EQClasses_iteratorequivalenceClasses ()
 
ASTContextgetContext ()
 
const SourceManagergetSourceManager ()
 
const AnalyzerOptionsgetAnalyzerOptions ()
 
PreprocessorgetPreprocessor ()
 
const DeclgetAnalysisEntryPoint () const
 Get the top-level entry point for the issue to be reported.
 
void setAnalysisEntryPoint (const Decl *EntryPoint)
 
virtual void emitReport (std::unique_ptr< BugReport > R)
 Add the given report to the set of reports tracked by BugReporter.
 
void EmitBasicReport (const Decl *DeclWithIssue, const CheckerBase *Checker, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=std::nullopt, ArrayRef< FixItHint > Fixits=std::nullopt)
 
void EmitBasicReport (const Decl *DeclWithIssue, CheckerNameRef CheckerName, StringRef BugName, StringRef BugCategory, StringRef BugStr, PathDiagnosticLocation Loc, ArrayRef< SourceRange > Ranges=std::nullopt, ArrayRef< FixItHint > Fixits=std::nullopt)
 

Additional Inherited Members

- Public Types inherited from clang::ento::BugReporter
using EQClasses_iterator = llvm::FoldingSet< BugReportEquivClass >::iterator
 Iterator over the set of BugReports tracked by the BugReporter.
 
virtual std::unique_ptr< DiagnosticForConsumerMapTygenerateDiagnosticForConsumerMap (BugReport *exampleReport, ArrayRef< PathDiagnosticConsumer * > consumers, ArrayRef< BugReport * > bugReports)
 Generate the diagnostics for the given bug report.
 

Detailed Description

GRBugReporter is used for generating path-sensitive reports.

Definition at line 679 of file BugReporter.h.

Constructor & Destructor Documentation

◆ PathSensitiveBugReporter()

clang::ento::PathSensitiveBugReporter::PathSensitiveBugReporter ( BugReporterData d,
ExprEngine eng 
)
inline

Definition at line 692 of file BugReporter.h.

Member Function Documentation

◆ emitReport()

void PathSensitiveBugReporter::emitReport ( std::unique_ptr< BugReport R)
overridevirtual

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 from clang::ento::BugReporter.

Definition at line 2959 of file BugReporter.cpp.

References E, clang::ento::BugReporter::emitReport(), clang::AnalysisDeclContext::isBodyAutosynthesized(), and clang::AnalysisDeclContext::isBodyAutosynthesizedFromModelFile().

◆ generatePathDiagnostics()

std::unique_ptr< DiagnosticForConsumerMapTy > PathSensitiveBugReporter::generatePathDiagnostics ( ArrayRef< PathDiagnosticConsumer * >  consumers,
ArrayRef< PathSensitiveBugReport * > &  bugReports 
)

bugReports A set of bug reports within a single equivalence class

Returns
A mapping from consumers to the corresponding diagnostics. Iterates through the bug reports within a single equivalence class, stops at a first non-invalidated report.

Definition at line 2910 of file BugReporter.cpp.

◆ getGraph()

const ExplodedGraph & PathSensitiveBugReporter::getGraph ( ) const

getGraph - Get the exploded graph created by the analysis engine for the analyzed method or function.

Definition at line 2476 of file BugReporter.cpp.

References clang::ento::ExprEngine::getGraph().

◆ getStateManager()

ProgramStateManager & PathSensitiveBugReporter::getStateManager ( ) const

getStateManager - Return the state manager used by the analysis engine.

Definition at line 2480 of file BugReporter.cpp.

References clang::ento::ExprEngine::getStateManager().

Referenced by clang::ento::BugReporterContext::getStateManager().


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