clang 20.0.0git
|
Classes | |
class | ExpressionHandler |
Handles expressions during the tracking. More... | |
class | StoreHandler |
Handles stores during the tracking. More... | |
struct | StoreInfo |
Describes an event when the value got stored into a memory region. More... | |
class | Tracker |
A generalized component for tracking expressions, values, and stores. More... | |
class | TrackingBugReporterVisitor |
Visitor that tracks expressions and values. More... | |
struct | TrackingOptions |
Defines a set of options altering tracking behavior. More... | |
Typedefs | |
using | TrackerRef = llvm::IntrusiveRefCntPtr< Tracker > |
Enumerations | |
enum class | TrackingKind { Thorough , Condition } |
Specifies the type of tracking for an expression. More... | |
Functions | |
bool | trackExpressionValue (const ExplodedNode *N, const Expr *E, PathSensitiveBugReport &R, TrackingOptions Opts={}) |
Attempts to add visitors to track expression value back to its point of origin. | |
void | trackStoredValue (SVal V, const MemRegion *R, PathSensitiveBugReport &Report, TrackingOptions Opts={}, const StackFrameContext *Origin=nullptr) |
Track how the value got stored into the given region and where it came from. | |
const Expr * | getDerefExpr (const Stmt *S) |
Given that expression S represents a pointer that would be dereferenced, try to find a sub-expression from which the pointer came from. | |
using clang::ento::bugreporter::TrackerRef = typedef llvm::IntrusiveRefCntPtr<Tracker> |
Definition at line 163 of file BugReporterVisitors.h.
|
strong |
Specifies the type of tracking for an expression.
Definition at line 102 of file BugReporterVisitors.h.
Given that expression S represents a pointer that would be dereferenced, try to find a sub-expression from which the pointer came from.
This is used for tracking down origins of a null or undefined value: "this is null because that is null because that is null" etc. We wipe away field and element offsets because they merely add offsets. We also wipe away all casts except lvalue-to-rvalue casts, because the latter represent an actual pointer dereference; however, we remove the final lvalue-to-rvalue cast before returning from this function because it demonstrates more clearly from where the pointer rvalue was loaded. Examples: x->y.z ==> x (lvalue) foo()->y.z ==> foo() (rvalue)
Definition at line 101 of file BugReporterVisitors.cpp.
References E, and peelOffPointerArithmetic().
Referenced by peelOffOuterExpr().
bool clang::ento::bugreporter::trackExpressionValue | ( | const ExplodedNode * | N, |
const Expr * | E, | ||
PathSensitiveBugReport & | R, | ||
TrackingOptions | Opts = {} |
||
) |
Attempts to add visitors to track expression value back to its point of origin.
N | A node "downstream" from the evaluation of the statement. |
E | The expression value which we are tracking |
R | The bug report to which visitors should be attached. |
Opts | Tracking options specifying how we are tracking the value. |
true
does not actually imply that any visitors were added. Definition at line 2689 of file BugReporterVisitors.cpp.
References clang::ento::bugreporter::Tracker::create(), and E.
Referenced by emitBug(), and clang::ento::NilReceiverBRVisitor::VisitNode().
void clang::ento::bugreporter::trackStoredValue | ( | SVal | V, |
const MemRegion * | R, | ||
PathSensitiveBugReport & | Report, | ||
TrackingOptions | Opts = {} , |
||
const StackFrameContext * | Origin = nullptr |
||
) |
Track how the value got stored into the given region and where it came from.
V | We're searching for the store where R received this value. It may be either defined or undefined, but should not be unknown. |
R | The region we're tracking. |
Opts | Tracking options specifying how we want to track the value. |
Origin | Only adds notes when the last store happened in a different stackframe to this one. Disregarded if the tracking kind is thorough. This is useful, because for non-tracked regions, notes about changes to its value in a nested stackframe could be pruned, and this visitor can prevent that without polluting the bugpath too much. |
Definition at line 2699 of file BugReporterVisitors.cpp.
References clang::ento::bugreporter::Tracker::create(), and V.