class BugReporterVisitor

Declaration

class BugReporterVisitor : public Node { /* full declaration omitted */ };

Description

BugReporterVisitors are used to add custom diagnostics along a path.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:48

Inherits from: FoldingSetBase::Node

Member Variables

Method Overview

  • public BugReporterVisitor()
  • public BugReporterVisitor(const clang::ento::BugReporterVisitor &)
  • public BugReporterVisitor(clang::ento::BugReporterVisitor &&)
  • public virtual void Profile(llvm::FoldingSetNodeID & ID) const
  • public virtual clang::ento::PathDiagnosticPieceRef VisitNode(const clang::ento::ExplodedNode * Succ, clang::ento::BugReporterContext & BRC, clang::ento::PathSensitiveBugReport & BR)
  • public virtual void finalizeVisitor(clang::ento::BugReporterContext & BRC, const clang::ento::ExplodedNode * EndPathNode, clang::ento::PathSensitiveBugReport & BR)
  • public static clang::ento::PathDiagnosticPieceRef getDefaultEndPath(const clang::ento::BugReporterContext & BRC, const clang::ento::ExplodedNode * N, const clang::ento::PathSensitiveBugReport & BR)
  • public virtual clang::ento::PathDiagnosticPieceRef getEndPath(clang::ento::BugReporterContext & BRC, const clang::ento::ExplodedNode * N, clang::ento::PathSensitiveBugReport & BR)
  • public virtual ~BugReporterVisitor()

Inherited from FoldingSetBase::Node:

Methods

BugReporterVisitor()

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:50

BugReporterVisitor(
    const clang::ento::BugReporterVisitor&)

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:51

Parameters

const clang::ento::BugReporterVisitor&

BugReporterVisitor(
    clang::ento::BugReporterVisitor&&)

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:52

Parameters

clang::ento::BugReporterVisitor&&

virtual void Profile(
    llvm::FoldingSetNodeID& ID) const

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:84

Parameters

llvm::FoldingSetNodeID& ID

virtual clang::ento::PathDiagnosticPieceRef
VisitNode(const clang::ento::ExplodedNode* Succ,
          clang::ento::BugReporterContext& BRC,
          clang::ento::PathSensitiveBugReport& BR)

Description

Return a diagnostic piece which should be associated with the given node. Note that this function does *not* get run on the very last node of the report, as the PathDiagnosticPiece associated with the last node should be unique. Use \ref getEndPath to customize the note associated with the report end instead. The last parameter can be used to register a new visitor with the given BugReport while processing a node.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:65

Parameters

const clang::ento::ExplodedNode* Succ
clang::ento::BugReporterContext& BRC
clang::ento::PathSensitiveBugReport& BR

virtual void finalizeVisitor(
    clang::ento::BugReporterContext& BRC,
    const clang::ento::ExplodedNode* EndPathNode,
    clang::ento::PathSensitiveBugReport& BR)

Description

Last function called on the visitor, no further calls to VisitNode would follow.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:71

Parameters

clang::ento::BugReporterContext& BRC
const clang::ento::ExplodedNode* EndPathNode
clang::ento::PathSensitiveBugReport& BR

static clang::ento::PathDiagnosticPieceRef
getDefaultEndPath(
    const clang::ento::BugReporterContext& BRC,
    const clang::ento::ExplodedNode* N,
    const clang::ento::PathSensitiveBugReport& BR)

Description

Generates the default final diagnostic piece.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:88

Parameters

const clang::ento::BugReporterContext& BRC
const clang::ento::ExplodedNode* N
const clang::ento::PathSensitiveBugReport& BR

virtual clang::ento::PathDiagnosticPieceRef
getEndPath(
    clang::ento::BugReporterContext& BRC,
    const clang::ento::ExplodedNode* N,
    clang::ento::PathSensitiveBugReport& BR)

Description

Provide custom definition for the final diagnostic piece on the path - the piece, which is displayed before the path is expanded. NOTE that this function can be implemented on at most one used visitor, and otherwise it crahes at runtime.

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:80

Parameters

clang::ento::BugReporterContext& BRC
const clang::ento::ExplodedNode* N
clang::ento::PathSensitiveBugReport& BR

virtual ~BugReporterVisitor()

Declared at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:53