clang API Documentation
#include <PathDiagnostic.h>
Public Types | |
typedef std::deque < std::string > ::const_iterator | meta_iterator |
Public Member Functions | |
PathDiagnostic (StringRef CheckName, const Decl *DeclWithIssue, StringRef bugtype, StringRef verboseDesc, StringRef shortDesc, StringRef category, PathDiagnosticLocation LocationToUnique, const Decl *DeclToUnique) | |
~PathDiagnostic () | |
PathPieces & | getActivePath () |
PathPieces & | getMutablePieces () |
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 (std::unique_ptr< PathDiagnosticPiece > EndPiece) |
void | appendToDesc (StringRef S) |
void | resetPath () |
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. | |
StringRef | getVerboseDescription () const |
StringRef | getShortDescription () const |
StringRef | getCheckName () const |
StringRef | getBugType () const |
StringRef | getCategory () const |
const Decl * | getDeclWithIssue () const |
meta_iterator | meta_begin () const |
meta_iterator | meta_end () const |
void | addMeta (StringRef s) |
PathDiagnosticLocation | getLocation () const |
PathDiagnosticLocation | getUniqueingLoc () const |
Get the location on which the report should be uniqued. | |
const Decl * | getUniqueingDecl () const |
Get the declaration containing the uniqueing location. | |
void | flattenLocations () |
void | Profile (llvm::FoldingSetNodeID &ID) const |
void | FullProfile (llvm::FoldingSetNodeID &ID) const |
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 713 of file PathDiagnostic.h.
typedef std::deque<std::string>::const_iterator clang::ento::PathDiagnostic::meta_iterator |
Definition at line 802 of file PathDiagnostic.h.
PathDiagnostic::PathDiagnostic | ( | StringRef | CheckName, |
const Decl * | DeclWithIssue, | ||
StringRef | bugtype, | ||
StringRef | verboseDesc, | ||
StringRef | shortDesc, | ||
StringRef | category, | ||
PathDiagnosticLocation | LocationToUnique, | ||
const Decl * | DeclToUnique | ||
) |
Definition at line 110 of file PathDiagnostic.cpp.
Definition at line 108 of file PathDiagnostic.cpp.
void clang::ento::PathDiagnostic::addMeta | ( | StringRef | s | ) | [inline] |
Definition at line 805 of file PathDiagnostic.h.
void clang::ento::PathDiagnostic::appendToDesc | ( | StringRef | S | ) | [inline] |
Definition at line 772 of file PathDiagnostic.h.
Referenced by resetDiagnosticLocationToMainFile().
void clang::ento::PathDiagnostic::flattenLocations | ( | ) | [inline] |
Definition at line 822 of file PathDiagnostic.h.
Return the unrolled size of the path.
Definition at line 1049 of file PathDiagnostic.cpp.
References compute_path_size().
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 1112 of file PathDiagnostic.cpp.
PathPieces& clang::ento::PathDiagnostic::getActivePath | ( | ) | [inline] |
Return the path currently used by builders for constructing the PathDiagnostic.
Definition at line 746 of file PathDiagnostic.h.
Referenced by GenerateAlternateExtensivePathDiagnostic(), GenerateExtensivePathDiagnostic(), GenerateMinimalPathDiagnostic(), and setEndOfPath().
StringRef clang::ento::PathDiagnostic::getBugType | ( | ) | const [inline] |
Definition at line 794 of file PathDiagnostic.h.
Referenced by compare().
StringRef clang::ento::PathDiagnostic::getCategory | ( | ) | const [inline] |
Definition at line 795 of file PathDiagnostic.h.
Referenced by compare().
StringRef clang::ento::PathDiagnostic::getCheckName | ( | ) | const [inline] |
Definition at line 793 of file PathDiagnostic.h.
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 800 of file PathDiagnostic.h.
Referenced by compare().
PathDiagnosticLocation clang::ento::PathDiagnostic::getLocation | ( | ) | const [inline] |
Definition at line 807 of file PathDiagnostic.h.
Referenced by compare(), and GenerateAlternateExtensivePathDiagnostic().
PathPieces& clang::ento::PathDiagnostic::getMutablePieces | ( | ) | [inline] |
Return a mutable version of 'path'.
Definition at line 753 of file PathDiagnostic.h.
Referenced by GenerateMinimalPathDiagnostic(), and clang::ento::GRBugReporter::generatePathDiagnostic().
StringRef clang::ento::PathDiagnostic::getShortDescription | ( | ) | const [inline] |
Definition at line 790 of file PathDiagnostic.h.
Referenced by compare().
const Decl* clang::ento::PathDiagnostic::getUniqueingDecl | ( | ) | const [inline] |
Get the declaration containing the uniqueing location.
Definition at line 818 of file PathDiagnostic.h.
PathDiagnosticLocation clang::ento::PathDiagnostic::getUniqueingLoc | ( | ) | const [inline] |
Get the location on which the report should be uniqued.
Definition at line 813 of file PathDiagnostic.h.
StringRef clang::ento::PathDiagnostic::getVerboseDescription | ( | ) | const [inline] |
Definition at line 789 of file PathDiagnostic.h.
Referenced by compare().
bool clang::ento::PathDiagnostic::isWithinCall | ( | ) | const [inline] |
Definition at line 763 of file PathDiagnostic.h.
Referenced by GenerateAlternateExtensivePathDiagnostic(), GenerateExtensivePathDiagnostic(), and GenerateMinimalPathDiagnostic().
meta_iterator clang::ento::PathDiagnostic::meta_begin | ( | ) | const [inline] |
Definition at line 803 of file PathDiagnostic.h.
Referenced by compare().
meta_iterator clang::ento::PathDiagnostic::meta_end | ( | ) | const [inline] |
Definition at line 804 of file PathDiagnostic.h.
Referenced by compare().
void clang::ento::PathDiagnostic::popActivePath | ( | ) | [inline] |
Definition at line 761 of file PathDiagnostic.h.
Referenced by GenerateAlternateExtensivePathDiagnostic(), GenerateExtensivePathDiagnostic(), and GenerateMinimalPathDiagnostic().
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 1105 of file PathDiagnostic.cpp.
void clang::ento::PathDiagnostic::pushActivePath | ( | PathPieces * | p | ) | [inline] |
Definition at line 760 of file PathDiagnostic.h.
Referenced by GenerateAlternateExtensivePathDiagnostic(), GenerateExtensivePathDiagnostic(), and GenerateMinimalPathDiagnostic().
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 156 of file PathDiagnostic.cpp.
References appendToDesc(), clang::NamedDecl::getDeclName(), getFirstStackedCallToHeaderFile(), clang::ento::PathDiagnosticPiece::getLocation(), clang::ento::PathDiagnosticLocation::getManager(), and path.
void clang::ento::PathDiagnostic::resetPath | ( | ) | [inline] |
Definition at line 778 of file PathDiagnostic.h.
Referenced by clang::ento::GRBugReporter::generatePathDiagnostic().
void clang::ento::PathDiagnostic::setEndOfPath | ( | std::unique_ptr< PathDiagnosticPiece > | EndPiece | ) | [inline] |
Definition at line 765 of file PathDiagnostic.h.
References getActivePath().
Referenced by clang::ento::GRBugReporter::generatePathDiagnostic().
Definition at line 742 of file PathDiagnostic.h.
Referenced by compare(), clang::ento::GRBugReporter::generatePathDiagnostic(), and resetDiagnosticLocationToMainFile().