|
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 28 of file FactsGenerator.h.
|
inline |
Definition at line 32 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 546 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 683 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 475 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 275 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCastExpr | ( | const CastExpr * | CE | ) |
Definition at line 286 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 616 of file FactsGenerator.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXConstructExpr | ( | const CXXConstructExpr * | CCE | ) |
Definition at line 205 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 235 of file FactsGenerator.cpp.
References clang::CXXDefaultInitExpr::getExpr(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | DE | ) |
Definition at line 787 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 593 of file FactsGenerator.cpp.
References VisitCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr | ( | const CXXMemberCallExpr * | MCE | ) |
Definition at line 247 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 279 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | OCE | ) |
Definition at line 561 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 767 of file FactsGenerator.cpp.
References clang::CXXThrowExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | TE | ) |
Definition at line 782 of file FactsGenerator.cpp.
References clang::CXXTypeidExpr::getExprOperand(), and clang::CXXTypeidExpr::isPotentiallyEvaluated().
| void clang::lifetimes::internal::FactsGenerator::VisitDeclRefExpr | ( | const DeclRefExpr * | DRE | ) |
Definition at line 179 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 166 of file FactsGenerator.cpp.
References clang::DeclStmt::decls().
| void clang::lifetimes::internal::FactsGenerator::VisitGCCAsmStmt | ( | const GCCAsmStmt * | AS | ) |
Definition at line 772 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 602 of file FactsGenerator.cpp.
References clang::InitListExpr::getInit(), and clang::InitListExpr::getNumInits().
| void clang::lifetimes::internal::FactsGenerator::VisitLambdaExpr | ( | const LambdaExpr * | LE | ) |
Definition at line 643 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 621 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::MaterializeTemporaryExpr::getStorageDuration(), clang::MaterializeTemporaryExpr::getSubExpr(), clang::Expr::isGLValue(), clang::lifetimes::internal::OriginList::peelOuterOrigin(), 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 413 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 795 of file FactsGenerator.cpp.
References clang::StmtExpr::getSubStmt(), and clang::Last.
| void clang::lifetimes::internal::FactsGenerator::VisitUnaryOperator | ( | const UnaryOperator * | UO | ) |
Definition at line 358 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().