|
clang 23.0.0git
|
#include "clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h"
Additional Inherited Members | |
| Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
| ParamTys | P |
Definition at line 27 of file FactsGenerator.h.
|
inline |
Definition at line 31 of file FactsGenerator.h.
References clang::CPlusPlus, and clang::ObjC.
| void clang::lifetimes::internal::FactsGenerator::run | ( | ) |
Definition at line 118 of file FactsGenerator.cpp.
References clang::Block, clang::CFGElement::getAs(), clang::CFG::getEntry(), clang::CFG::getExit(), clang::Initializer, and clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys >::Visit().
Referenced by clang::lifetimes::internal::LifetimeSafetyAnalysis::run().
| void clang::lifetimes::internal::FactsGenerator::VisitAbstractConditionalOperator | ( | const AbstractConditionalOperator * | CO | ) |
Visits conditional operators (e.g., cond ?
a : b).
To prevent liveness leakage across loop backedges (which causes false positives like in while (...) { int x; consume(cond ? &x : nullptr); }), we generate the flow facts in the respective predecessor blocks of the arms rather than in the merge block. This ensures that the liveness of the temporary origin from one arm does not propagate into the other arm's path.
Definition at line 596 of file FactsGenerator.cpp.
References clang::lifetimes::internal::findPredBlockForExpr(), clang::AbstractConditionalOperator::getFalseExpr(), and clang::AbstractConditionalOperator::getTrueExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitArraySubscriptExpr | ( | const ArraySubscriptExpr * | ASE | ) |
Definition at line 722 of file FactsGenerator.cpp.
References clang::ArraySubscriptExpr::getBase(), clang::lifetimes::internal::OriginList::getOuterOriginID(), and clang::Expr::isGLValue().
| void clang::lifetimes::internal::FactsGenerator::VisitBinaryOperator | ( | const BinaryOperator * | BO | ) |
Definition at line 523 of file FactsGenerator.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::BinaryOperator::getRHS(), clang::lifetimes::internal::getRValueOrigins(), clang::Expr::getType(), clang::BinaryOperator::isAdditiveOp(), clang::BinaryOperator::isAssignmentOp(), clang::BinaryOperator::isCompoundAssignmentOp(), clang::Type::isPointerType(), and clang::lifetimes::internal::OriginList::peelOuterOrigin().
| void clang::lifetimes::internal::FactsGenerator::VisitCallExpr | ( | const CallExpr * | CE | ) |
Definition at line 291 of file FactsGenerator.cpp.
References clang::CallExpr::getDirectCallee().
| void clang::lifetimes::internal::FactsGenerator::VisitCastExpr | ( | const CastExpr * | CE | ) |
Definition at line 303 of file FactsGenerator.cpp.
References clang::CastExpr::getCastKind(), clang::lifetimes::internal::OriginList::getLength(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::lifetimes::internal::getRValueOrigins(), clang::CastExpr::getSubExpr(), clang::Expr::IgnoreParens(), clang::isa(), and clang::Expr::isGLValue().
Referenced by VisitCXXFunctionalCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | BTE | ) |
Definition at line 671 of file FactsGenerator.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXConstructExpr | ( | const CXXConstructExpr * | CCE | ) |
Definition at line 208 of file FactsGenerator.cpp.
References clang::CXXConstructExpr::getArg(), clang::Type::getAsCXXRecordDecl(), clang::CXXConstructExpr::getConstructor(), clang::CXXConstructExpr::getNumArgs(), clang::lifetimes::internal::getRValueOrigins(), clang::Expr::getType(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::FunctionDecl::isDefaulted(), clang::lifetimes::isGslPointerType(), and clang::lifetimes::isStdCallableWrapperType().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | DIE | ) |
Definition at line 240 of file FactsGenerator.cpp.
References clang::CXXDefaultInitExpr::getExpr(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | DE | ) |
Definition at line 803 of file FactsGenerator.cpp.
References clang::CXXDeleteExpr::getArgument(), and clang::lifetimes::internal::OriginList::getOuterOriginID().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXFunctionalCastExpr | ( | const CXXFunctionalCastExpr * | FCE | ) |
Definition at line 648 of file FactsGenerator.cpp.
References VisitCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr | ( | const CXXMemberCallExpr * | MCE | ) |
Definition at line 252 of file FactsGenerator.cpp.
References clang::CallExpr::getArgs(), clang::CallExpr::getCalleeDecl(), clang::CXXMemberCallExpr::getImplicitObjectArgument(), clang::CXXMemberCallExpr::getMethodDecl(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), clang::lifetimes::isGslOwnerType(), clang::lifetimes::isGslPointerType(), and clang::Method.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXNewExpr | ( | const CXXNewExpr * | NE | ) |
| void clang::lifetimes::internal::FactsGenerator::VisitCXXNullPtrLiteralExpr | ( | const CXXNullPtrLiteralExpr * | N | ) |
TODO: Handle nullptr expr as a special 'null' loan. Uninitialized pointers can use the same type of loan.
Definition at line 296 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | OCE | ) |
Definition at line 611 of file FactsGenerator.cpp.
References clang::CallExpr::getArg(), clang::CallExpr::getArgs(), clang::Type::getAsCXXRecordDecl(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getNumArgs(), clang::CXXOperatorCallExpr::getOperator(), clang::Expr::getType(), clang::lifetimes::isGslOwnerType(), clang::lifetimes::isGslPointerType(), clang::Type::isPointerOrReferenceType(), clang::FunctionDecl::isStatic(), and clang::lifetimes::isStdCallableWrapperType().
| void clang::lifetimes::internal::FactsGenerator::VisitDeclRefExpr | ( | const DeclRefExpr * | DRE | ) |
Definition at line 181 of file FactsGenerator.cpp.
References clang::lifetimes::internal::createLoan(), clang::lifetimes::internal::doesDeclHaveStorage(), clang::DeclRefExpr::getDecl(), clang::DeclRefExpr::getFoundDecl(), clang::lifetimes::internal::Loan::getID(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::Decl::isFunctionOrFunctionTemplate(), and clang::Expr::isGLValue().
| void clang::lifetimes::internal::FactsGenerator::VisitDeclStmt | ( | const DeclStmt * | DS | ) |
Definition at line 168 of file FactsGenerator.cpp.
References clang::DeclStmt::decls().
| void clang::lifetimes::internal::FactsGenerator::VisitInitListExpr | ( | const InitListExpr * | ILE | ) |
Definition at line 657 of file FactsGenerator.cpp.
References clang::InitListExpr::getInit(), and clang::InitListExpr::getNumInits().
| void clang::lifetimes::internal::FactsGenerator::VisitLambdaExpr | ( | const LambdaExpr * | LE | ) |
Definition at line 698 of file FactsGenerator.cpp.
References clang::lifetimes::internal::OriginList::getOuterOriginID(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | MTE | ) |
Definition at line 676 of file FactsGenerator.cpp.
References clang::lifetimes::internal::createLoan(), clang::lifetimes::internal::Loan::getID(), clang::lifetimes::internal::OriginList::getLength(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::lifetimes::internal::getRValueOrigins(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), clang::Expr::isGLValue(), and clang::SD_FullExpression.
| void clang::lifetimes::internal::FactsGenerator::VisitMemberExpr | ( | const MemberExpr * | ME | ) |
| void clang::lifetimes::internal::FactsGenerator::VisitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 433 of file FactsGenerator.cpp.
References clang::ReturnStmt::getRetValue(), and clang::lifetimes::internal::OriginList::peelOuterOrigin().
| void clang::lifetimes::internal::FactsGenerator::VisitStmtExpr | ( | const StmtExpr * | SE | ) |
Definition at line 809 of file FactsGenerator.cpp.
References clang::lifetimes::internal::getRValueOrigins(), clang::StmtExpr::getSubStmt(), and clang::Last.
| void clang::lifetimes::internal::FactsGenerator::VisitUnaryOperator | ( | const UnaryOperator * | UO | ) |
Definition at line 377 of file FactsGenerator.cpp.
References clang::UnaryOperator::getOpcode(), clang::lifetimes::internal::getRValueOrigins(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Type::isFunctionType(), clang::Expr::isGLValue(), clang::Type::isPointerType(), clang::Type::isVoidType(), and clang::lifetimes::internal::OriginList::peelOuterOrigin().