|
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 29 of file FactsGenerator.h.
|
inline |
Definition at line 33 of file FactsGenerator.h.
References clang::CPlusPlus, and clang::ObjC.
| void clang::lifetimes::internal::FactsGenerator::run | ( | ) |
Definition at line 119 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 556 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 697 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 485 of file FactsGenerator.cpp.
References clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::BinaryOperator::getRHS(), 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 285 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCastExpr | ( | const CastExpr * | CE | ) |
Definition at line 296 of file FactsGenerator.cpp.
References clang::CastExpr::getCastKind(), clang::lifetimes::internal::OriginList::getLength(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::CastExpr::getSubExpr(), clang::Expr::IgnoreParens(), and clang::isa().
Referenced by VisitCXXFunctionalCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | BTE | ) |
Definition at line 626 of file FactsGenerator.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXConstructExpr | ( | const CXXConstructExpr * | CCE | ) |
Definition at line 206 of file FactsGenerator.cpp.
References clang::CXXConstructExpr::getArg(), clang::Type::getAsCXXRecordDecl(), clang::CXXConstructExpr::getConstructor(), clang::CXXConstructExpr::getNumArgs(), 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 236 of file FactsGenerator.cpp.
References clang::CXXDefaultInitExpr::getExpr(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | DE | ) |
Definition at line 801 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 603 of file FactsGenerator.cpp.
References VisitCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr | ( | const CXXMemberCallExpr * | MCE | ) |
Definition at line 248 of file FactsGenerator.cpp.
References clang::CallExpr::getCalleeDecl(), clang::CXXMemberCallExpr::getImplicitObjectArgument(), clang::Expr::getType(), clang::lifetimes::isGslOwnerType(), and clang::lifetimes::isGslPointerType().
| 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 289 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | OCE | ) |
Definition at line 571 of file FactsGenerator.cpp.
References clang::CallExpr::getArg(), clang::Type::getAsCXXRecordDecl(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getNumArgs(), clang::CXXOperatorCallExpr::getOperator(), clang::Expr::getType(), clang::lifetimes::isGslOwnerType(), clang::lifetimes::isGslPointerType(), clang::Type::isPointerOrReferenceType(), and clang::lifetimes::isStdCallableWrapperType().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXThrowExpr | ( | const CXXThrowExpr * | TE | ) |
Definition at line 781 of file FactsGenerator.cpp.
References clang::CXXThrowExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | TE | ) |
Definition at line 796 of file FactsGenerator.cpp.
References clang::CXXTypeidExpr::getExprOperand(), and clang::CXXTypeidExpr::isPotentiallyEvaluated().
| void clang::lifetimes::internal::FactsGenerator::VisitDeclRefExpr | ( | const DeclRefExpr * | DRE | ) |
Definition at line 180 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 167 of file FactsGenerator.cpp.
References clang::DeclStmt::decls().
| void clang::lifetimes::internal::FactsGenerator::VisitGCCAsmStmt | ( | const GCCAsmStmt * | AS | ) |
Definition at line 786 of file FactsGenerator.cpp.
References clang::AsmStmt::getNumOutputs(), clang::GCCAsmStmt::getOutputExpr(), clang::AsmStmt::inputs(), and clang::AsmStmt::isOutputPlusConstraint().
| void clang::lifetimes::internal::FactsGenerator::VisitInitListExpr | ( | const InitListExpr * | ILE | ) |
Definition at line 612 of file FactsGenerator.cpp.
References clang::InitListExpr::getInit(), and clang::InitListExpr::getNumInits().
| void clang::lifetimes::internal::FactsGenerator::VisitLambdaExpr | ( | const LambdaExpr * | LE | ) |
Definition at line 657 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 631 of file FactsGenerator.cpp.
References clang::lifetimes::internal::createLoan(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::lifetimes::internal::Loan::getID(), clang::lifetimes::internal::OriginList::getLength(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), clang::Expr::isGLValue(), clang::lifetimes::internal::OriginList::peelOuterOrigin(), and clang::SD_Automatic.
| void clang::lifetimes::internal::FactsGenerator::VisitMemberExpr | ( | const MemberExpr * | ME | ) |
Definition at line 260 of file FactsGenerator.cpp.
References clang::lifetimes::internal::createLoan(), clang::lifetimes::internal::doesDeclHaveStorage(), clang::MemberExpr::getBase(), clang::lifetimes::internal::Loan::getID(), clang::MemberExpr::getMemberDecl(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::isa(), and clang::Expr::isGLValue().
| void clang::lifetimes::internal::FactsGenerator::VisitReturnStmt | ( | const ReturnStmt * | RS | ) |
Definition at line 423 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::StmtExpr::getSubStmt(), and clang::Last.
| void clang::lifetimes::internal::FactsGenerator::VisitUnaryOperator | ( | const UnaryOperator * | UO | ) |
Definition at line 368 of file FactsGenerator.cpp.
References clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::getType(), clang::Type::isFunctionType(), clang::Expr::isGLValue(), clang::Type::isPointerType(), clang::Type::isVoidType(), and clang::lifetimes::internal::OriginList::peelOuterOrigin().