|
clang 23.0.0git
|
Manages the creation, storage, and retrieval of origins for pointer-like variables and expressions. More...
#include "clang/Analysis/Analyses/LifetimeSafety/Origins.h"
Public Member Functions | |
| OriginManager (const AnalysisDeclContext &AC) | |
| OriginList * | getOrCreateList (const ValueDecl *D) |
| Gets or creates the OriginList for a given ValueDecl. | |
| OriginList * | getOrCreateList (const Expr *E) |
| Gets or creates the OriginList for a given Expr. | |
| std::optional< OriginList * > | getThisOrigins () const |
| Returns the OriginList for the implicit 'this' parameter if the current declaration is an instance method. | |
| const Origin & | getOrigin (OriginID ID) const |
| llvm::ArrayRef< Origin > | getOrigins () const |
| unsigned | getNumOrigins () const |
| bool | hasOrigins (QualType QT) const |
| bool | hasOrigins (const Expr *E) const |
| Determines if an expression has origins that need to be tracked. | |
| void | dump (OriginID OID, llvm::raw_ostream &OS) const |
| void | collectMissingOrigins (Stmt &FunctionBody, LifetimeSafetyStats &LSStats) |
| Collects statistics about expressions that lack associated origins. | |
Manages the creation, storage, and retrieval of origins for pointer-like variables and expressions.
|
explicit |
Definition at line 155 of file Origins.cpp.
References clang::AnalysisDeclContext::getDecl().
| void clang::lifetimes::internal::OriginManager::collectMissingOrigins | ( | Stmt & | FunctionBody, |
| LifetimeSafetyStats & | LSStats ) |
Collects statistics about expressions that lack associated origins.
Definition at line 291 of file Origins.cpp.
Referenced by clang::lifetimes::internal::collectLifetimeStats().
| void clang::lifetimes::internal::OriginManager::dump | ( | OriginID | OID, |
| llvm::raw_ostream & | OS ) const |
Definition at line 267 of file Origins.cpp.
References clang::QualType::getAsString(), clang::lifetimes::internal::Origin::getDecl(), clang::lifetimes::internal::Origin::getExpr(), getOrigin(), clang::Stmt::getStmtClassName(), and clang::lifetimes::internal::Origin::Ty.
Referenced by clang::lifetimes::internal::ExpireFact::dump(), clang::lifetimes::internal::FieldEscapeFact::dump(), clang::lifetimes::internal::GlobalEscapeFact::dump(), clang::lifetimes::internal::InvalidateOriginFact::dump(), clang::lifetimes::internal::IssueFact::dump(), clang::lifetimes::internal::MovedOriginFact::dump(), clang::lifetimes::internal::OriginFlowFact::dump(), clang::lifetimes::internal::ReturnEscapeFact::dump(), and clang::lifetimes::internal::UseFact::dump().
|
inline |
Definition at line 155 of file Origins.h.
Referenced by clang::lifetimes::internal::computePersistentOrigins().
| OriginList * clang::lifetimes::internal::OriginManager::getOrCreateList | ( | const Expr * | E | ) |
Gets or creates the OriginList for a given Expr.
Creates a list based on the expression's type and value category:
Definition at line 208 of file Origins.cpp.
References clang::lifetimes::internal::doesDeclHaveStorage(), getOrCreateList(), clang::Expr::getType(), hasOrigins(), clang::Expr::IgnoreParens(), clang::isa(), clang::Expr::isGLValue(), clang::Type::isReferenceType(), and clang::lifetimes::internal::OriginList::setInnerOriginList().
| OriginList * clang::lifetimes::internal::OriginManager::getOrCreateList | ( | const ValueDecl * | D | ) |
Gets or creates the OriginList for a given ValueDecl.
Creates a list structure mirroring the levels of indirection in the declaration's type (e.g., int** p creates list of size 2).
Definition at line 199 of file Origins.cpp.
References clang::ValueDecl::getType(), and hasOrigins().
Referenced by getOrCreateList().
Definition at line 286 of file Origins.cpp.
Referenced by dump().
|
inline |
|
inline |
Returns the OriginList for the implicit 'this' parameter if the current declaration is an instance method.
Determines if an expression has origins that need to be tracked.
An expression has origins if:
Examples:
Definition at line 134 of file Origins.cpp.
References clang::Expr::getType(), hasOrigins(), and clang::Expr::isGLValue().
Definition at line 102 of file Origins.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::QualType::getCanonicalType(), clang::QualType::getTypePtr(), hasOrigins(), clang::lifetimes::isGslPointerType(), and clang::Type::isPointerOrReferenceType().
Referenced by getOrCreateList(), getOrCreateList(), hasOrigins(), and hasOrigins().