clang
7.0.0
|
PathDiagnostic - PathDiagnostic objects represent a single path-sensitive diagnostic. More...
#include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
Public Types | |
using | meta_iterator = std::deque< std::string >::const_iterator |
using | filesmap_iterator = FilesToLineNumsMap::const_iterator |
Public Member Functions | |
PathDiagnostic ()=delete | |
PathDiagnostic (StringRef CheckName, const Decl *DeclWithIssue, StringRef bugtype, StringRef verboseDesc, StringRef shortDesc, StringRef category, PathDiagnosticLocation LocationToUnique, const Decl *DeclToUnique, std::unique_ptr< FilesToLineNumsMap > ExecutedLines) | |
~PathDiagnostic () | |
PathPieces & | getActivePath () |
Return the path currently used by builders for constructing the PathDiagnostic. More... | |
PathPieces & | getMutablePieces () |
Return a mutable version of 'path'. More... | |
unsigned | full_size () |
Return the unrolled size of the path. More... | |
void | pushActivePath (PathPieces *p) |
void | popActivePath () |
bool | isWithinCall () const |
void | setEndOfPath (std::shared_ptr< PathDiagnosticPiece > EndPiece) |
void | appendToDesc (StringRef S) |
void | resetDiagnosticLocationToMainFile () |
If the last piece of the report point to the header file, resets the location of the report to be the last location in the main source file. More... | |
StringRef | getVerboseDescription () const |
StringRef | getShortDescription () const |
StringRef | getCheckName () const |
StringRef | getBugType () const |
StringRef | getCategory () const |
const Decl * | getDeclWithIssue () const |
Return the semantic context where an issue occurred. More... | |
meta_iterator | meta_begin () const |
meta_iterator | meta_end () const |
void | addMeta (StringRef s) |
filesmap_iterator | executedLines_begin () const |
filesmap_iterator | executedLines_end () const |
PathDiagnosticLocation | getLocation () const |
PathDiagnosticLocation | getUniqueingLoc () const |
Get the location on which the report should be uniqued. More... | |
const Decl * | getUniqueingDecl () const |
Get the declaration containing the uniqueing location. More... | |
void | flattenLocations () |
void | Profile (llvm::FoldingSetNodeID &ID) const |
Profiles the diagnostic, independent of the path it references. More... | |
void | FullProfile (llvm::FoldingSetNodeID &ID) const |
Profiles the diagnostic, including its path. More... | |
Public Attributes | |
const PathPieces & | path |
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 768 of file PathDiagnostic.h.
using clang::ento::PathDiagnostic::filesmap_iterator = FilesToLineNumsMap::const_iterator |
Definition at line 862 of file PathDiagnostic.h.
using clang::ento::PathDiagnostic::meta_iterator = std::deque<std::string>::const_iterator |
Definition at line 856 of file PathDiagnostic.h.
|
delete |
PathDiagnostic::PathDiagnostic | ( | StringRef | CheckName, |
const Decl * | DeclWithIssue, | ||
StringRef | bugtype, | ||
StringRef | verboseDesc, | ||
StringRef | shortDesc, | ||
StringRef | category, | ||
PathDiagnosticLocation | LocationToUnique, | ||
const Decl * | DeclToUnique, | ||
std::unique_ptr< FilesToLineNumsMap > | ExecutedLines | ||
) |
Definition at line 131 of file PathDiagnostic.cpp.
|
default |
|
inline |
Definition at line 860 of file PathDiagnostic.h.
|
inline |
Definition at line 830 of file PathDiagnostic.h.
Referenced by resetDiagnosticLocationToMainFile().
|
inline |
Definition at line 864 of file PathDiagnostic.h.
|
inline |
Definition at line 868 of file PathDiagnostic.h.
|
inline |
Definition at line 884 of file PathDiagnostic.h.
References clang::ento::PathDiagnosticLocation::flatten().
unsigned PathDiagnostic::full_size | ( | ) |
Return the unrolled size of the path.
Definition at line 1195 of file PathDiagnostic.cpp.
References compute_path_size(), and path.
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 1257 of file PathDiagnostic.cpp.
References Profile().
|
inline |
Return the path currently used by builders for constructing the PathDiagnostic.
Definition at line 804 of file PathDiagnostic.h.
Referenced by generateMinimalDiagForBlockEdge(), and generatePathDiagnosticsForNode().
|
inline |
Definition at line 848 of file PathDiagnostic.h.
Referenced by compare().
|
inline |
|
inline |
Definition at line 847 of file PathDiagnostic.h.
|
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 854 of file PathDiagnostic.h.
Referenced by compare().
|
inline |
Definition at line 870 of file PathDiagnostic.h.
Referenced by compare(), clang::ento::PathDiagnosticEventPiece::dump(), clang::ento::PathDiagnosticCallPiece::dump(), clang::ento::PathDiagnosticNotePiece::dump(), and Profile().
|
inline |
Return a mutable version of 'path'.
Definition at line 811 of file PathDiagnostic.h.
|
inline |
Definition at line 843 of file PathDiagnostic.h.
Referenced by compare().
|
inline |
Get the declaration containing the uniqueing location.
Definition at line 880 of file PathDiagnostic.h.
|
inline |
Get the location on which the report should be uniqued.
Definition at line 875 of file PathDiagnostic.h.
|
inline |
Definition at line 841 of file PathDiagnostic.h.
Referenced by compare(), and showRelevantLinesJavascript().
|
inline |
Definition at line 821 of file PathDiagnostic.h.
Referenced by generatePathDiagnosticsForNode().
|
inline |
Definition at line 858 of file PathDiagnostic.h.
Referenced by compare().
|
inline |
Definition at line 859 of file PathDiagnostic.h.
Referenced by compare().
|
inline |
Definition at line 819 of file PathDiagnostic.h.
Referenced by generatePathDiagnosticsForNode().
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 1250 of file PathDiagnostic.cpp.
References getLocation().
Referenced by FullProfile().
|
inline |
Definition at line 818 of file PathDiagnostic.h.
Referenced by generatePathDiagnosticsForNode().
void PathDiagnostic::resetDiagnosticLocationToMainFile | ( | ) |
If the last piece of the report point to the header file, resets the location of the report to be the last location in the main source file.
Definition at line 173 of file PathDiagnostic.cpp.
References appendToDesc(), getFirstStackedCallToHeaderFile(), clang::ento::PathDiagnosticPiece::getLocation(), clang::ento::PathDiagnosticLocation::getManager(), and path.
|
inline |
Definition at line 823 of file PathDiagnostic.h.
References clang::ento::PathDiagnosticLocation::isValid().
const PathPieces& clang::ento::PathDiagnostic::path |
Definition at line 800 of file PathDiagnostic.h.
Referenced by compare(), full_size(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), ReportPiece(), and resetDiagnosticLocationToMainFile().