clang 18.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::ento::PathDiagnostic Class Reference

PathDiagnostic - PathDiagnostic objects represent a single path-sensitive diagnostic. More...

#include "clang/Analysis/PathDiagnostic.h"

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

Public Types

using meta_iterator = std::deque< std::string >::const_iterator
 

Public Member Functions

 PathDiagnostic ()=delete
 
 PathDiagnostic (StringRef CheckerName, const Decl *DeclWithIssue, StringRef bugtype, StringRef verboseDesc, StringRef shortDesc, StringRef category, PathDiagnosticLocation LocationToUnique, const Decl *DeclToUnique, std::unique_ptr< FilesToLineNumsMap > ExecutedLines)
 
 ~PathDiagnostic ()
 
PathPiecesgetActivePath ()
 Return the path currently used by builders for constructing the PathDiagnostic.
 
PathPiecesgetMutablePieces ()
 Return a mutable version of 'path'.
 
unsigned full_size ()
 Return the unrolled size of the path.
 
void pushActivePath (PathPieces *p)
 
void popActivePath ()
 
bool isWithinCall () const
 
void setEndOfPath (PathDiagnosticPieceRef EndPiece)
 
void appendToDesc (StringRef S)
 
StringRef getVerboseDescription () const
 
StringRef getShortDescription () const
 
StringRef getCheckerName () const
 
StringRef getBugType () const
 
StringRef getCategory () const
 
meta_iterator meta_begin () const
 
meta_iterator meta_end () const
 
void addMeta (StringRef s)
 
const FilesToLineNumsMapgetExecutedLines () const
 
FilesToLineNumsMapgetExecutedLines ()
 
const DeclgetDeclWithIssue () const
 Return the semantic context where an issue occurred.
 
void setDeclWithIssue (const Decl *D)
 
PathDiagnosticLocation getLocation () const
 
void setLocation (PathDiagnosticLocation NewLoc)
 
PathDiagnosticLocation getUniqueingLoc () const
 Get the location on which the report should be uniqued.
 
const DeclgetUniqueingDecl () const
 Get the declaration containing the uniqueing location.
 
void flattenLocations ()
 
void Profile (llvm::FoldingSetNodeID &ID) const
 Profiles the diagnostic, independent of the path it references.
 
void FullProfile (llvm::FoldingSetNodeID &ID) const
 Profiles the diagnostic, including its path.
 

Public Attributes

const PathPiecespath
 

Detailed Description

PathDiagnostic - PathDiagnostic objects represent a single path-sensitive diagnostic.

It represents an ordered-collection of PathDiagnosticPieces, each which represent the pieces of the path.

Definition at line 763 of file PathDiagnostic.h.

Member Typedef Documentation

◆ meta_iterator

using clang::ento::PathDiagnostic::meta_iterator = std::deque<std::string>::const_iterator

Definition at line 841 of file PathDiagnostic.h.

Constructor & Destructor Documentation

◆ PathDiagnostic() [1/2]

clang::ento::PathDiagnostic::PathDiagnostic ( )
delete

◆ PathDiagnostic() [2/2]

PathDiagnostic::PathDiagnostic ( StringRef  CheckerName,
const Decl DeclWithIssue,
StringRef  bugtype,
StringRef  verboseDesc,
StringRef  shortDesc,
StringRef  category,
PathDiagnosticLocation  LocationToUnique,
const Decl DeclToUnique,
std::unique_ptr< FilesToLineNumsMap ExecutedLines 
)

Definition at line 119 of file PathDiagnostic.cpp.

◆ ~PathDiagnostic()

PathDiagnostic::~PathDiagnostic ( )
default

Member Function Documentation

◆ addMeta()

void clang::ento::PathDiagnostic::addMeta ( StringRef  s)
inline

Definition at line 845 of file PathDiagnostic.h.

References s.

◆ appendToDesc()

void clang::ento::PathDiagnostic::appendToDesc ( StringRef  S)
inline

Definition at line 825 of file PathDiagnostic.h.

Referenced by resetDiagnosticLocationToMainFile().

◆ flattenLocations()

void clang::ento::PathDiagnostic::flattenLocations ( )
inline

Definition at line 882 of file PathDiagnostic.h.

◆ full_size()

unsigned PathDiagnostic::full_size ( )

Return the unrolled size of the path.

Definition at line 1079 of file PathDiagnostic.cpp.

References compute_path_size().

◆ FullProfile()

void PathDiagnostic::FullProfile ( llvm::FoldingSetNodeID &  ID) const

Profiles the diagnostic, including its path.

Two diagnostics with the same issue along different paths will generate different profiles.

Definition at line 1146 of file PathDiagnostic.cpp.

◆ getActivePath()

PathPieces & clang::ento::PathDiagnostic::getActivePath ( )
inline

Return the path currently used by builders for constructing the PathDiagnostic.

Definition at line 799 of file PathDiagnostic.h.

Referenced by setEndOfPath().

◆ getBugType()

StringRef clang::ento::PathDiagnostic::getBugType ( ) const
inline

Definition at line 838 of file PathDiagnostic.h.

Referenced by compare(), and getIssueHash().

◆ getCategory()

StringRef clang::ento::PathDiagnostic::getCategory ( ) const
inline

Definition at line 839 of file PathDiagnostic.h.

References Category.

Referenced by compare().

◆ getCheckerName()

StringRef clang::ento::PathDiagnostic::getCheckerName ( ) const
inline

Definition at line 837 of file PathDiagnostic.h.

Referenced by getIssueHash().

◆ getDeclWithIssue()

const Decl * clang::ento::PathDiagnostic::getDeclWithIssue ( ) const
inline

Return the semantic context where an issue occurred.

If the issue occurs along a path, this represents the "central" area where the bug manifests.

Definition at line 858 of file PathDiagnostic.h.

Referenced by compare(), and getIssueHash().

◆ getExecutedLines() [1/2]

FilesToLineNumsMap & clang::ento::PathDiagnostic::getExecutedLines ( )
inline

Definition at line 851 of file PathDiagnostic.h.

◆ getExecutedLines() [2/2]

const FilesToLineNumsMap & clang::ento::PathDiagnostic::getExecutedLines ( ) const
inline

Definition at line 847 of file PathDiagnostic.h.

Referenced by printCoverage(), and updateExecutedLinesWithDiagnosticPieces().

◆ getLocation()

PathDiagnosticLocation clang::ento::PathDiagnostic::getLocation ( ) const
inline

Definition at line 864 of file PathDiagnostic.h.

Referenced by compare(), and getIssueHash().

◆ getMutablePieces()

PathPieces & clang::ento::PathDiagnostic::getMutablePieces ( )
inline

Return a mutable version of 'path'.

Definition at line 806 of file PathDiagnostic.h.

◆ getShortDescription()

StringRef clang::ento::PathDiagnostic::getShortDescription ( ) const
inline

Definition at line 833 of file PathDiagnostic.h.

Referenced by compare().

◆ getUniqueingDecl()

const Decl * clang::ento::PathDiagnostic::getUniqueingDecl ( ) const
inline

Get the declaration containing the uniqueing location.

Definition at line 878 of file PathDiagnostic.h.

Referenced by compare().

◆ getUniqueingLoc()

PathDiagnosticLocation clang::ento::PathDiagnostic::getUniqueingLoc ( ) const
inline

Get the location on which the report should be uniqued.

Definition at line 873 of file PathDiagnostic.h.

Referenced by compare(), and getIssueHash().

◆ getVerboseDescription()

StringRef clang::ento::PathDiagnostic::getVerboseDescription ( ) const
inline

Definition at line 831 of file PathDiagnostic.h.

Referenced by compare(), and shouldDisplayPopUpRange().

◆ isWithinCall()

bool clang::ento::PathDiagnostic::isWithinCall ( ) const
inline

Definition at line 816 of file PathDiagnostic.h.

◆ meta_begin()

meta_iterator clang::ento::PathDiagnostic::meta_begin ( ) const
inline

Definition at line 843 of file PathDiagnostic.h.

Referenced by compare().

◆ meta_end()

meta_iterator clang::ento::PathDiagnostic::meta_end ( ) const
inline

Definition at line 844 of file PathDiagnostic.h.

Referenced by compare().

◆ popActivePath()

void clang::ento::PathDiagnostic::popActivePath ( )
inline

Definition at line 814 of file PathDiagnostic.h.

◆ Profile()

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

Profiles the diagnostic, independent of the path it references.

This can be used to merge diagnostics that refer to the same issue along different paths.

Definition at line 1138 of file PathDiagnostic.cpp.

References Category.

◆ pushActivePath()

void clang::ento::PathDiagnostic::pushActivePath ( PathPieces p)
inline

Definition at line 813 of file PathDiagnostic.h.

◆ setDeclWithIssue()

void clang::ento::PathDiagnostic::setDeclWithIssue ( const Decl D)
inline

Definition at line 860 of file PathDiagnostic.h.

Referenced by resetDiagnosticLocationToMainFile().

◆ setEndOfPath()

void clang::ento::PathDiagnostic::setEndOfPath ( PathDiagnosticPieceRef  EndPiece)
inline

Definition at line 818 of file PathDiagnostic.h.

References getActivePath(), and clang::ento::DefinedSVal::isValid().

◆ setLocation()

void clang::ento::PathDiagnostic::setLocation ( PathDiagnosticLocation  NewLoc)
inline

Definition at line 868 of file PathDiagnostic.h.

Referenced by resetDiagnosticLocationToMainFile().

Member Data Documentation

◆ path

const PathPieces& clang::ento::PathDiagnostic::path

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