|
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 132 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 600 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 749 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 529 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 328 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCastExpr | ( | const CastExpr * | CE | ) |
Definition at line 339 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 677 of file FactsGenerator.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXConstructExpr | ( | const CXXConstructExpr * | CCE | ) |
Definition at line 219 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::VisitCXXDefaultArgExpr | ( | const CXXDefaultArgExpr * | DAE | ) |
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDefaultInitExpr | ( | const CXXDefaultInitExpr * | DIE | ) |
Definition at line 264 of file FactsGenerator.cpp.
References clang::CXXDefaultInitExpr::getExpr(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXDeleteExpr | ( | const CXXDeleteExpr * | DE | ) |
Definition at line 853 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 654 of file FactsGenerator.cpp.
References VisitCastExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXMemberCallExpr | ( | const CXXMemberCallExpr * | MCE | ) |
Definition at line 284 of file FactsGenerator.cpp.
References clang::CallExpr::getArg(), clang::CallExpr::getCallee(), clang::CallExpr::getCalleeDecl(), clang::CXXMemberCallExpr::getImplicitObjectArgument(), clang::CXXMemberCallExpr::getMethodDecl(), clang::FunctionDecl::getOverloadedOperator(), 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 332 of file FactsGenerator.cpp.
| void clang::lifetimes::internal::FactsGenerator::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | OCE | ) |
Definition at line 644 of file FactsGenerator.cpp.
References clang::CallExpr::getArg(), clang::CallExpr::getNumArgs(), and clang::CXXOperatorCallExpr::getOperator().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXThrowExpr | ( | const CXXThrowExpr * | TE | ) |
Definition at line 833 of file FactsGenerator.cpp.
References clang::CXXThrowExpr::getSubExpr().
| void clang::lifetimes::internal::FactsGenerator::VisitCXXTypeidExpr | ( | const CXXTypeidExpr * | TE | ) |
Definition at line 848 of file FactsGenerator.cpp.
References clang::CXXTypeidExpr::getExprOperand(), and clang::CXXTypeidExpr::isPotentiallyEvaluated().
| void clang::lifetimes::internal::FactsGenerator::VisitDeclRefExpr | ( | const DeclRefExpr * | DRE | ) |
Definition at line 193 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 180 of file FactsGenerator.cpp.
References clang::DeclStmt::decls().
| void clang::lifetimes::internal::FactsGenerator::VisitGCCAsmStmt | ( | const GCCAsmStmt * | AS | ) |
Definition at line 838 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 663 of file FactsGenerator.cpp.
References clang::InitListExpr::getInit(), and clang::InitListExpr::getNumInits().
| void clang::lifetimes::internal::FactsGenerator::VisitLambdaExpr | ( | const LambdaExpr * | LE | ) |
Definition at line 708 of file FactsGenerator.cpp.
References clang::C, clang::cast(), clang::lifetimes::internal::OriginList::getOuterOriginID(), clang::lifetimes::ignoreParensAndImpCasts(), and clang::Init.
| void clang::lifetimes::internal::FactsGenerator::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | MTE | ) |
Definition at line 682 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 303 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 467 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 861 of file FactsGenerator.cpp.
References clang::StmtExpr::getSubStmt(), and clang::Last.
| void clang::lifetimes::internal::FactsGenerator::VisitUnaryOperator | ( | const UnaryOperator * | UO | ) |
Definition at line 412 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().