|
clang 24.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 597 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 737 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 524 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 292 of file FactsGenerator.cpp.
References clang::CallExpr::getDirectCallee().
| void clang::lifetimes::internal::FactsGenerator::VisitCastExpr | ( | const CastExpr * | CE | ) |
Definition at line 304 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 672 of file FactsGenerator.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXConstructExpr | ( | const CXXConstructExpr * | CCE | ) |
Definition at line 209 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 241 of file FactsGenerator.cpp.
References clang::CXXDefaultInitExpr::getExpr(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | DE | ) |
Definition at line 818 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 649 of file FactsGenerator.cpp.
References VisitCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr | ( | const CXXMemberCallExpr * | MCE | ) |
Definition at line 253 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 297 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | OCE | ) |
Definition at line 612 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 182 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 169 of file FactsGenerator.cpp.
References clang::DeclStmt::decls().
| void clang::lifetimes::internal::FactsGenerator::VisitInitListExpr | ( | const InitListExpr * | ILE | ) |
Definition at line 658 of file FactsGenerator.cpp.
References clang::InitListExpr::getInit(), and clang::InitListExpr::getNumInits().
| void clang::lifetimes::internal::FactsGenerator::VisitLambdaExpr | ( | const LambdaExpr * | LE | ) |
Definition at line 699 of file FactsGenerator.cpp.
References clang::C, clang::cast(), clang::lifetimes::internal::OriginList::getOuterOriginID(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | MTE | ) |
Definition at line 677 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 434 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 824 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 378 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().