clang 22.0.0git
|
Public Member Functions | |
FactGenerator (FactManager &FactMgr, AnalysisDeclContext &AC) | |
void | run () |
void | VisitDeclStmt (const DeclStmt *DS) |
void | VisitDeclRefExpr (const DeclRefExpr *DRE) |
void | VisitCXXConstructExpr (const CXXConstructExpr *CCE) |
void | VisitCXXMemberCallExpr (const CXXMemberCallExpr *MCE) |
void | VisitCXXNullPtrLiteralExpr (const CXXNullPtrLiteralExpr *N) |
void | VisitImplicitCastExpr (const ImplicitCastExpr *ICE) |
void | VisitUnaryOperator (const UnaryOperator *UO) |
void | VisitReturnStmt (const ReturnStmt *RS) |
void | VisitBinaryOperator (const BinaryOperator *BO) |
void | VisitCXXOperatorCallExpr (const CXXOperatorCallExpr *OCE) |
void | VisitCXXFunctionalCastExpr (const CXXFunctionalCastExpr *FCE) |
void | VisitInitListExpr (const InitListExpr *ILE) |
void | VisitMaterializeTemporaryExpr (const MaterializeTemporaryExpr *MTE) |
void | handleDestructor (const CFGAutomaticObjDtor &DtorOpt) |
Public Member Functions inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
RetTy | Visit (PTR(Stmt) S, ParamTys... P) |
BINOP_FALLBACK (PtrMemD) BINOP_FALLBACK(PtrMemI) BINOP_FALLBACK(Mul) BINOP_FALLBACK(Div) BINOP_FALLBACK(Rem) BINOP_FALLBACK(Add) BINOP_FALLBACK(Sub) BINOP_FALLBACK(Shl) BINOP_FALLBACK(LT) BINOP_FALLBACK(GT) BINOP_FALLBACK(LE) BINOP_FALLBACK(GE) BINOP_FALLBACK(EQ) BINOP_FALLBACK(NE) BINOP_FALLBACK(And) BINOP_FALLBACK(Xor) BINOP_FALLBACK(Or) BINOP_FALLBACK(LAnd) BINOP_FALLBACK(LOr) CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign) CAO_FALLBACK(AddAssign) CAO_FALLBACK(SubAssign) CAO_FALLBACK(ShlAssign) CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign) UNARYOP_FALLBACK(PostInc) UNARYOP_FALLBACK(PostDec) UNARYOP_FALLBACK(PreInc) UNARYOP_FALLBACK(PreDec) UNARYOP_FALLBACK(AddrOf) UNARYOP_FALLBACK(Deref) UNARYOP_FALLBACK(Plus) UNARYOP_FALLBACK(Minus) UNARYOP_FALLBACK(Not) UNARYOP_FALLBACK(LNot) UNARYOP_FALLBACK(Real) UNARYOP_FALLBACK(Imag) UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(Coawait) RetTy VisitStmt(PTR(Stmt) Node |
Additional Inherited Members | |
Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
ParamTys | P { return RetTy() |
Definition at line 427 of file LifetimeSafety.cpp.
|
inline |
Definition at line 431 of file LifetimeSafety.cpp.
|
inline |
TODO: Also handle trivial destructors (e.g., for int variables) which will never have a CFGAutomaticObjDtor node. TODO: Handle loans to temporaries. TODO: Consider using clang::CFG::BuildOptions::AddLifetime to reuse the lifetime ends.
TODO(opt): Do better than a linear search to find loans associated with 'DestructedVD'.
Definition at line 575 of file LifetimeSafety.cpp.
References clang::lifetimes::internal::AccessPath::D, clang::Stmt::getEndLoc(), clang::CFGAutomaticObjDtor::getTriggerStmt(), and clang::CFGAutomaticObjDtor::getVarDecl().
Referenced by run().
|
inline |
Definition at line 434 of file LifetimeSafety.cpp.
References clang::Block, clang::CFGElement::getAs(), handleDestructor(), and clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys >::Visit().
Referenced by clang::lifetimes::internal::LifetimeSafetyAnalysis::run().
|
inline |
Definition at line 539 of file LifetimeSafety.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getRHS(), and clang::BinaryOperator::isAssignmentOp().
|
inline |
Definition at line 481 of file LifetimeSafety.cpp.
References clang::Expr::getType().
|
inline |
Definition at line 549 of file LifetimeSafety.cpp.
References clang::CastExpr::getSubExpr(), and clang::Expr::getType().
|
inline |
Definition at line 488 of file LifetimeSafety.cpp.
References clang::CallExpr::getCalleeDecl(), clang::CXXMemberCallExpr::getMethodDecl(), clang::Expr::getType(), and clang::isa().
|
inline |
TODO: Handle nullptr expr as a special 'null' loan. Uninitialized pointers can use the same type of loan.
Definition at line 500 of file LifetimeSafety.cpp.
|
inline |
Definition at line 544 of file LifetimeSafety.cpp.
References clang::CallExpr::getArg(), clang::CallExpr::getNumArgs(), and clang::CXXOperatorCallExpr::isAssignmentOp().
|
inline |
Definition at line 460 of file LifetimeSafety.cpp.
References clang::Expr::getType().
|
inline |
Definition at line 452 of file LifetimeSafety.cpp.
References clang::DeclStmt::decls().
|
inline |
Definition at line 506 of file LifetimeSafety.cpp.
References clang::CastExpr::getSubExpr().
|
inline |
Definition at line 558 of file LifetimeSafety.cpp.
References clang::InitListExpr::getInit(), and clang::InitListExpr::getNumInits().
|
inline |
Definition at line 567 of file LifetimeSafety.cpp.
References clang::MaterializeTemporaryExpr::getSubExpr().
|
inline |
Definition at line 529 of file LifetimeSafety.cpp.
References clang::ReturnStmt::getRetValue().
|
inline |
Definition at line 514 of file LifetimeSafety.cpp.
References clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), and clang::Expr::getType().