clang
10.0.0git
|
#include "clang/Analysis/PathDiagnostic.h"
Public Member Functions | |
PathDiagnosticLocation ()=default | |
Create an invalid location. More... | |
PathDiagnosticLocation (const Stmt *s, const SourceManager &sm, LocationOrAnalysisDeclContext lac) | |
Create a location corresponding to the given statement. More... | |
PathDiagnosticLocation (const Decl *d, const SourceManager &sm) | |
Create a location corresponding to the given declaration. More... | |
PathDiagnosticLocation (SourceLocation loc, const SourceManager &sm) | |
Create a location at an explicit offset in the source. More... | |
bool | operator== (const PathDiagnosticLocation &X) const |
bool | operator!= (const PathDiagnosticLocation &X) const |
bool | isValid () const |
FullSourceLoc | asLocation () const |
PathDiagnosticRange | asRange () const |
const Stmt * | asStmt () const |
const Stmt * | getStmtOrNull () const |
const Decl * | asDecl () const |
bool | hasRange () const |
bool | hasValidLocation () const |
void | invalidate () |
void | flatten () |
const SourceManager & | getManager () const |
void | Profile (llvm::FoldingSetNodeID &ID) const |
void | dump () const |
Static Public Member Functions | |
static PathDiagnosticLocation | create (const Decl *D, const SourceManager &SM) |
Create a location corresponding to the given declaration. More... | |
static PathDiagnosticLocation | createBegin (const Decl *D, const SourceManager &SM) |
Create a location for the beginning of the declaration. More... | |
static PathDiagnosticLocation | createBegin (const Decl *D, const SourceManager &SM, const LocationOrAnalysisDeclContext LAC) |
Create a location for the beginning of the declaration. More... | |
static PathDiagnosticLocation | createBegin (const Stmt *S, const SourceManager &SM, const LocationOrAnalysisDeclContext LAC) |
Create a location for the beginning of the statement. More... | |
static PathDiagnosticLocation | createEnd (const Stmt *S, const SourceManager &SM, const LocationOrAnalysisDeclContext LAC) |
Create a location for the end of the statement. More... | |
static PathDiagnosticLocation | createOperatorLoc (const BinaryOperator *BO, const SourceManager &SM) |
Create the location for the operator of the binary expression. More... | |
static PathDiagnosticLocation | createConditionalColonLoc (const ConditionalOperator *CO, const SourceManager &SM) |
static PathDiagnosticLocation | createMemberLoc (const MemberExpr *ME, const SourceManager &SM) |
For member expressions, return the location of the '. More... | |
static PathDiagnosticLocation | createBeginBrace (const CompoundStmt *CS, const SourceManager &SM) |
Create a location for the beginning of the compound statement. More... | |
static PathDiagnosticLocation | createEndBrace (const CompoundStmt *CS, const SourceManager &SM) |
Create a location for the end of the compound statement. More... | |
static PathDiagnosticLocation | createDeclBegin (const LocationContext *LC, const SourceManager &SM) |
Create a location for the beginning of the enclosing declaration body. More... | |
static PathDiagnosticLocation | createDeclEnd (const LocationContext *LC, const SourceManager &SM) |
Constructs a location for the end of the enclosing declaration body. More... | |
static PathDiagnosticLocation | create (const ProgramPoint &P, const SourceManager &SMng) |
Create a location corresponding to the given valid ProgramPoint. More... | |
static PathDiagnosticLocation | createSingleLocation (const PathDiagnosticLocation &PDL) |
Convert the given location into a single kind location. More... | |
static SourceLocation | getValidSourceLocation (const Stmt *S, LocationOrAnalysisDeclContext LAC, bool UseEndOfStatement=false) |
Construct a source location that corresponds to either the beginning or the end of the given statement, or a nearby valid source location if the statement does not have a valid source location of its own. More... | |
Definition at line 157 of file PathDiagnostic.h.
|
default |
Create an invalid location.
|
inline |
Create a location corresponding to the given statement.
Definition at line 182 of file PathDiagnostic.h.
References clang::SourceLocation::isValid(), and clang::SourceRange::isValid().
|
inline |
Create a location corresponding to the given declaration.
Definition at line 193 of file PathDiagnostic.h.
References clang::SourceLocation::isValid(), and clang::SourceRange::isValid().
|
inline |
Create a location at an explicit offset in the source.
This should only be used if there are no more appropriate constructors.
Definition at line 203 of file PathDiagnostic.h.
References clang::SourceLocation::isValid(), and clang::SourceRange::isValid().
|
inline |
Definition at line 316 of file PathDiagnostic.h.
|
inline |
Definition at line 301 of file PathDiagnostic.h.
Referenced by compare(), compareCall(), compareControlFlow(), comparePiece(), createSingleLocation(), clang::ento::PathDiagnosticConsumer::HandlePathDiagnostic(), and clang::ento::taint::TaintBugVisitor::VisitNode().
|
inline |
Definition at line 305 of file PathDiagnostic.h.
Referenced by clang::ento::PathDiagnosticSpotPiece::PathDiagnosticSpotPiece().
|
inline |
Definition at line 309 of file PathDiagnostic.h.
|
inlinestatic |
Create a location corresponding to the given declaration.
Definition at line 210 of file PathDiagnostic.h.
Referenced by checkObjCUnusedIvar(), getLocationForCaller(), LookThroughTransitiveAssignmentsAndCommaOperators(), and clang::ento::mpi::MPIBugReporter::reportUnmatchedWait().
|
static |
Create a location corresponding to the given valid ProgramPoint.
Definition at line 649 of file PathDiagnostic.cpp.
|
static |
Create a location for the beginning of the declaration.
Definition at line 564 of file PathDiagnostic.cpp.
References clang::Decl::getBeginLoc(), and SM.
Referenced by CheckASTMemory(), CompareReturnTypes(), constructDebugPieceForTrackedCondition(), dropFunctionEntryEdge(), emitDiagnostics(), getAsPointeeSymbol(), getFuchsiaHandleSymbol(), getIncrementedVar(), clang::ento::PathSensitiveBugReport::getLocation(), LookThroughTransitiveAssignmentsAndCommaOperators(), printExpectedDeallocName(), clang::ento::PathDiagnosticCallPiece::setCallee(), updateExecutedLinesWithDiagnosticPieces(), and clang::ento::taint::TaintBugVisitor::VisitNode().
|
inlinestatic |
Create a location for the beginning of the declaration.
The third argument is ignored, useful for generic treatment of statements and declarations.
Definition at line 223 of file PathDiagnostic.h.
References clang::serialized_diags::create(), and P.
|
static |
Create a location for the beginning of the statement.
Definition at line 570 of file PathDiagnostic.cpp.
|
static |
Create a location for the beginning of the compound statement.
Assumes the statement has a valid location.
Definition at line 615 of file PathDiagnostic.cpp.
References clang::CompoundStmt::getLBracLoc().
|
static |
Definition at line 594 of file PathDiagnostic.cpp.
References clang::AbstractConditionalOperator::getColonLoc(), and SM.
|
static |
Create a location for the beginning of the enclosing declaration body.
Defaults to the beginning of the first statement in the declaration body.
Definition at line 629 of file PathDiagnostic.cpp.
References clang::Decl::getBody(), and clang::LocationContext::getDecl().
|
static |
Constructs a location for the end of the enclosing declaration body.
Defaults to the end of brace.
Definition at line 642 of file PathDiagnostic.cpp.
References clang::Decl::getBodyRBrace(), and clang::LocationContext::getDecl().
Referenced by clang::ento::PathSensitiveBugReport::getLocation(), and removePiecesWithInvalidLocations().
|
static |
Create a location for the end of the statement.
If the statement is a CompoundStatement, the location will point to the closing brace instead of following it.
Definition at line 578 of file PathDiagnostic.cpp.
Referenced by clang::ento::PathSensitiveBugReport::getLocation(), and getLocationForCaller().
|
static |
Create a location for the end of the compound statement.
Assumes the statement has a valid location.
Definition at line 622 of file PathDiagnostic.cpp.
References clang::CompoundStmt::getRBracLoc().
|
static |
For member expressions, return the location of the '.
' or '->'. Assumes the statement has a valid location.
Definition at line 601 of file PathDiagnostic.cpp.
References clang::MemberExpr::getBeginLoc(), clang::MemberExpr::getMemberLoc(), clang::SourceLocation::isValid(), and SM.
Referenced by clang::ento::PathSensitiveBugReport::getLocation().
|
static |
Create the location for the operator of the binary expression.
Assumes the statement has a valid location.
Definition at line 588 of file PathDiagnostic.cpp.
References clang::BinaryOperator::getOperatorLoc(), and SM.
Referenced by clang::ento::PathSensitiveBugReport::getLocation().
|
static |
Convert the given location into a single kind location.
Definition at line 720 of file PathDiagnostic.cpp.
References asLocation(), and clang::FullSourceLoc::getManager().
Referenced by CompactMacroExpandedPieces().
LLVM_DUMP_METHOD void PathDiagnosticLocation::dump | ( | ) | const |
Definition at line 1186 of file PathDiagnostic.cpp.
Referenced by clang::ento::PathDiagnosticEventPiece::dump(), clang::ento::PathDiagnosticCallPiece::dump(), clang::ento::PathDiagnosticNotePiece::dump(), clang::ento::PathDiagnosticPopUpPiece::dump(), and getFuchsiaHandleSymbol().
void PathDiagnosticLocation::flatten | ( | ) |
|
inline |
Definition at line 328 of file PathDiagnostic.h.
References dump(), clang::ento::PathDiagnosticConsumer::PDFileEntry::Profile(), and SM.
|
inline |
Definition at line 310 of file PathDiagnostic.h.
|
static |
Construct a source location that corresponds to either the beginning or the end of the given statement, or a nearby valid source location if the statement does not have a valid source location of its own.
Definition at line 462 of file PathDiagnostic.cpp.
Referenced by clang::ento::PathSensitiveBugReport::getLocation().
|
inline |
Definition at line 318 of file PathDiagnostic.h.
Referenced by clang::ento::PathDiagnosticSpotPiece::PathDiagnosticSpotPiece().
|
inline |
Definition at line 320 of file PathDiagnostic.h.
Referenced by clang::ento::PathDiagnosticSpotPiece::PathDiagnosticSpotPiece().
|
inline |
Definition at line 322 of file PathDiagnostic.h.
|
inline |
Definition at line 297 of file PathDiagnostic.h.
Referenced by clang::ento::retaincountchecker::RefLeakReport::getLocation(), clang::ento::BasicBugReport::getLocation(), clang::ento::PathDiagnosticSpotPiece::PathDiagnosticSpotPiece(), clang::ento::PathSensitiveBugReport::Profile(), clang::ento::PathDiagnostic::setEndOfPath(), and clang::ento::taint::TaintBugVisitor::VisitNode().
|
inline |
Definition at line 293 of file PathDiagnostic.h.
References X.
|
inline |
Definition at line 289 of file PathDiagnostic.h.
void PathDiagnosticLocation::Profile | ( | llvm::FoldingSetNodeID & | ID | ) | const |
Definition at line 1069 of file PathDiagnostic.cpp.
Referenced by clang::ento::PathDiagnosticLocationPair::Profile(), and clang::ento::PathSensitiveBugReport::Profile().