class BugReporter
Declaration
class BugReporter { /* full declaration omitted */ };
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
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:585
Member Variables
- private clang::ento::BugReporterData& D
- private llvm::FoldingSet<BugReportEquivClass> EQClasses
- The set of bug reports tracked by the BugReporter.
- private std::vector<BugReportEquivClass*> EQClassesVector
- A vector of BugReports for tracking the allocated pointers and cleanup.
- private llvm::StringMap<std::unique_ptr<BugType>> StrBugTypes
Method Overview
- public BugReporter(clang::ento::BugReporterData & d)
- public clang::ento::BugReporter::EQClasses_iterator EQClasses_begin()
- public clang::ento::BugReporter::EQClasses_iterator EQClasses_end()
- public void EmitBasicReport(const clang::Decl * DeclWithIssue, clang::ento::CheckerNameRef CheckerName, llvm::StringRef BugName, llvm::StringRef BugCategory, llvm::StringRef BugStr, clang::ento::PathDiagnosticLocation Loc, ArrayRef<clang::SourceRange> Ranges = None, ArrayRef<clang::FixItHint> Fixits = None)
- public void EmitBasicReport(const clang::Decl * DeclWithIssue, const clang::ento::CheckerBase * Checker, llvm::StringRef BugName, llvm::StringRef BugCategory, llvm::StringRef BugStr, clang::ento::PathDiagnosticLocation Loc, ArrayRef<clang::SourceRange> Ranges = None, ArrayRef<clang::FixItHint> Fixits = None)
- private void FlushReport(clang::ento::BugReportEquivClass & EQ)
- public void FlushReports()
- public virtual void emitReport(std::unique_ptr<BugReport> R)
- private virtual clang::ento::BugReport * findReportInEquivalenceClass(clang::ento::BugReportEquivClass & eqClass, SmallVectorImpl<clang::ento::BugReport *> & bugReports)
- protected virtual std::unique_ptr<DiagnosticForConsumerMapTy> generateDiagnosticForConsumerMap(clang::ento::BugReport * exampleReport, ArrayRef<clang::ento::PathDiagnosticConsumer *> consumers, ArrayRef<clang::ento::BugReport *> bugReports)
- public const clang::AnalyzerOptions & getAnalyzerOptions()
- private clang::ento::BugType * getBugTypeForName(clang::ento::CheckerNameRef CheckerName, llvm::StringRef name, llvm::StringRef category)
- public clang::ASTContext & getContext()
- public ArrayRef<clang::ento::PathDiagnosticConsumer *> getPathDiagnosticConsumers()
- public clang::Preprocessor & getPreprocessor()
- public const clang::SourceManager & getSourceManager()
- public virtual ~BugReporter()
Methods
¶BugReporter(clang::ento::BugReporterData& d)
BugReporter(clang::ento::BugReporterData& d)
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:599
Parameters
¶clang::ento::BugReporter::EQClasses_iterator
EQClasses_begin()
clang::ento::BugReporter::EQClasses_iterator
EQClasses_begin()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:611
¶clang::ento::BugReporter::EQClasses_iterator
EQClasses_end()
clang::ento::BugReporter::EQClasses_iterator
EQClasses_end()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:612
¶void EmitBasicReport(
const clang::Decl* DeclWithIssue,
clang::ento::CheckerNameRef CheckerName,
llvm::StringRef BugName,
llvm::StringRef BugCategory,
llvm::StringRef BugStr,
clang::ento::PathDiagnosticLocation Loc,
ArrayRef<clang::SourceRange> Ranges = None,
ArrayRef<clang::FixItHint> Fixits = None)
void EmitBasicReport(
const clang::Decl* DeclWithIssue,
clang::ento::CheckerNameRef CheckerName,
llvm::StringRef BugName,
llvm::StringRef BugCategory,
llvm::StringRef BugStr,
clang::ento::PathDiagnosticLocation Loc,
ArrayRef<clang::SourceRange> Ranges = None,
ArrayRef<clang::FixItHint> Fixits = None)
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:635
Parameters
- const clang::Decl* DeclWithIssue
- clang::ento::CheckerNameRef CheckerName
- llvm::StringRef BugName
- llvm::StringRef BugCategory
- llvm::StringRef BugStr
- clang::ento::PathDiagnosticLocation Loc
- ArrayRef<clang::SourceRange> Ranges = None
- ArrayRef<clang::FixItHint> Fixits = None
¶void EmitBasicReport(
const clang::Decl* DeclWithIssue,
const clang::ento::CheckerBase* Checker,
llvm::StringRef BugName,
llvm::StringRef BugCategory,
llvm::StringRef BugStr,
clang::ento::PathDiagnosticLocation Loc,
ArrayRef<clang::SourceRange> Ranges = None,
ArrayRef<clang::FixItHint> Fixits = None)
void EmitBasicReport(
const clang::Decl* DeclWithIssue,
const clang::ento::CheckerBase* Checker,
llvm::StringRef BugName,
llvm::StringRef BugCategory,
llvm::StringRef BugStr,
clang::ento::PathDiagnosticLocation Loc,
ArrayRef<clang::SourceRange> Ranges = None,
ArrayRef<clang::FixItHint> Fixits = None)
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:629
Parameters
- const clang::Decl* DeclWithIssue
- const clang::ento::CheckerBase* Checker
- llvm::StringRef BugName
- llvm::StringRef BugCategory
- llvm::StringRef BugStr
- clang::ento::PathDiagnosticLocation Loc
- ArrayRef<clang::SourceRange> Ranges = None
- ArrayRef<clang::FixItHint> Fixits = None
¶void FlushReport(
clang::ento::BugReportEquivClass& EQ)
void FlushReport(
clang::ento::BugReportEquivClass& EQ)
Description
Generate and flush the diagnostics for the given bug report.
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:590
Parameters
¶void FlushReports()
void FlushReports()
Description
Generate and flush diagnostics for all bug reports.
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:603
¶virtual void emitReport(
std::unique_ptr<BugReport> R)
virtual void emitReport(
std::unique_ptr<BugReport> R)
Description
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.
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:627
Parameters
- std::unique_ptr<BugReport> R
¶virtual clang::ento::BugReport*
findReportInEquivalenceClass(
clang::ento::BugReportEquivClass& eqClass,
SmallVectorImpl<clang::ento::BugReport*>&
bugReports)
virtual clang::ento::BugReport*
findReportInEquivalenceClass(
clang::ento::BugReportEquivClass& eqClass,
SmallVectorImpl<clang::ento::BugReport*>&
bugReports)
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:650
Parameters
- clang::ento::BugReportEquivClass& eqClass
- SmallVectorImpl<clang::ento::BugReport*>& bugReports
¶virtual std::unique_ptr<
DiagnosticForConsumerMapTy>
generateDiagnosticForConsumerMap(
clang::ento::BugReport* exampleReport,
ArrayRef<clang::ento::PathDiagnosticConsumer*>
consumers,
ArrayRef<clang::ento::BugReport*> bugReports)
virtual std::unique_ptr<
DiagnosticForConsumerMapTy>
generateDiagnosticForConsumerMap(
clang::ento::BugReport* exampleReport,
ArrayRef<clang::ento::PathDiagnosticConsumer*>
consumers,
ArrayRef<clang::ento::BugReport*> bugReports)
Description
Generate the diagnostics for the given bug report.
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:658
Parameters
- clang::ento::BugReport* exampleReport
- ArrayRef<clang::ento::PathDiagnosticConsumer*> consumers
- ArrayRef<clang::ento::BugReport*> bugReports
¶const clang::AnalyzerOptions& getAnalyzerOptions()
const clang::AnalyzerOptions& getAnalyzerOptions()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:618
¶clang::ento::BugType* getBugTypeForName(
clang::ento::CheckerNameRef CheckerName,
llvm::StringRef name,
llvm::StringRef category)
clang::ento::BugType* getBugTypeForName(
clang::ento::CheckerNameRef CheckerName,
llvm::StringRef name,
llvm::StringRef category)
Description
Returns a BugType that is associated with the given name and category.
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:646
Parameters
- clang::ento::CheckerNameRef CheckerName
- llvm::StringRef name
- llvm::StringRef category
¶clang::ASTContext& getContext()
clang::ASTContext& getContext()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:614
¶ArrayRef<clang::ento::PathDiagnosticConsumer*>
getPathDiagnosticConsumers()
ArrayRef<clang::ento::PathDiagnosticConsumer*>
getPathDiagnosticConsumers()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:605
¶clang::Preprocessor& getPreprocessor()
clang::Preprocessor& getPreprocessor()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:620
¶const clang::SourceManager& getSourceManager()
const clang::SourceManager& getSourceManager()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:616
¶virtual ~BugReporter()
virtual ~BugReporter()
Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h:600