clang 22.0.0git
|
Public Member Functions | |
void | checkCallability (const PropagationInfo &PInfo, const FunctionDecl *FunDecl, SourceLocation BlameLoc) |
bool | handleCall (const CallExpr *Call, const Expr *ObjArg, const FunctionDecl *FunD) |
void | VisitBinaryOperator (const BinaryOperator *BinOp) |
void | VisitCallExpr (const CallExpr *Call) |
void | VisitCastExpr (const CastExpr *Cast) |
void | VisitCXXBindTemporaryExpr (const CXXBindTemporaryExpr *Temp) |
void | VisitCXXConstructExpr (const CXXConstructExpr *Call) |
void | VisitCXXMemberCallExpr (const CXXMemberCallExpr *Call) |
void | VisitCXXOperatorCallExpr (const CXXOperatorCallExpr *Call) |
void | VisitDeclRefExpr (const DeclRefExpr *DeclRef) |
void | VisitDeclStmt (const DeclStmt *DelcS) |
void | VisitMaterializeTemporaryExpr (const MaterializeTemporaryExpr *Temp) |
void | VisitMemberExpr (const MemberExpr *MExpr) |
void | VisitParmVarDecl (const ParmVarDecl *Param) |
void | VisitReturnStmt (const ReturnStmt *Ret) |
void | VisitUnaryOperator (const UnaryOperator *UOp) |
void | VisitVarDecl (const VarDecl *Var) |
ConsumedStmtVisitor (ConsumedAnalyzer &Analyzer, ConsumedStateMap *StateMap) | |
PropagationInfo | getInfo (const Expr *StmtNode) const |
void | reset (ConsumedStateMap *NewStateMap) |
Public Member Functions inherited from clang::StmtVisitorBase< llvm::make_const_ptr, ConsumedStmtVisitor, void, ParamTys... > | |
void | Visit (PTR(Stmt) S, ParamTys... P) |
BINOP_FALLBACK (PtrMemD) BINOP_FALLBACK(PtrMemI) BINOP_FALLBACK(Mul) BINOP_FALLBACK(Div) BINOP_FALLBACK(Rem) BINOP_FALLBACK(Add) BINOP_FALLBACK(Sub) BINOP_FALLBACK(Shl) BINOP_FALLBACK(LT) BINOP_FALLBACK(GT) BINOP_FALLBACK(LE) BINOP_FALLBACK(GE) BINOP_FALLBACK(EQ) BINOP_FALLBACK(NE) BINOP_FALLBACK(And) BINOP_FALLBACK(Xor) BINOP_FALLBACK(Or) BINOP_FALLBACK(LAnd) BINOP_FALLBACK(LOr) CAO_FALLBACK(MulAssign) CAO_FALLBACK(DivAssign) CAO_FALLBACK(RemAssign) CAO_FALLBACK(AddAssign) CAO_FALLBACK(SubAssign) CAO_FALLBACK(ShlAssign) CAO_FALLBACK(ShrAssign) CAO_FALLBACK(AndAssign) CAO_FALLBACK(OrAssign) UNARYOP_FALLBACK(PostInc) UNARYOP_FALLBACK(PostDec) UNARYOP_FALLBACK(PreInc) UNARYOP_FALLBACK(PreDec) UNARYOP_FALLBACK(AddrOf) UNARYOP_FALLBACK(Deref) UNARYOP_FALLBACK(Plus) UNARYOP_FALLBACK(Minus) UNARYOP_FALLBACK(Not) UNARYOP_FALLBACK(LNot) UNARYOP_FALLBACK(Real) UNARYOP_FALLBACK(Imag) UNARYOP_FALLBACK(Extension) UNARYOP_FALLBACK(Coawait) void VisitStmt(PTR(Stmt) Node |
Additional Inherited Members | |
Public Attributes inherited from clang::StmtVisitorBase< llvm::make_const_ptr, ConsumedStmtVisitor, void, ParamTys... > | |
ParamTys | P |
Definition at line 452 of file Consumed.cpp.
|
inline |
Definition at line 509 of file Consumed.cpp.
void ConsumedStmtVisitor::checkCallability | ( | const PropagationInfo & | PInfo, |
const FunctionDecl * | FunDecl, | ||
SourceLocation | BlameLoc ) |
Definition at line 572 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::PropagationInfo::getAsState(), clang::Decl::getAttr(), clang::NamedDecl::getNameAsString(), clang::consumed::PropagationInfo::getVar(), isCallableInState(), clang::consumed::PropagationInfo::isTest(), clang::consumed::PropagationInfo::isVar(), and stateToString().
Referenced by handleCall(), and clang::consumed::ConsumedAnalyzer::run().
|
inline |
Definition at line 512 of file Consumed.cpp.
bool ConsumedStmtVisitor::handleCall | ( | const CallExpr * | Call, |
const Expr * | ObjArg, | ||
const FunctionDecl * | FunD ) |
Definition at line 604 of file Consumed.cpp.
References clang::Call, checkCallability(), clang::consumed::CS_Consumed, clang::consumed::CS_Unknown, clang::consumed::PropagationInfo::getAsState(), clang::Decl::getAttr(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::Type::getPointeeType(), clang::consumed::PropagationInfo::getTmp(), clang::consumed::PropagationInfo::getVar(), clang::isa(), clang::QualType::isConstQualified(), isConsumableType(), clang::Type::isPointerOrReferenceType(), isRValueRef(), isSetOnReadPtrType(), isTestingFunction(), clang::consumed::PropagationInfo::isTmp(), clang::consumed::PropagationInfo::isVar(), mapParamTypestateAttrState(), mapReturnTypestateAttrState(), mapSetTypestateAttrState(), setStateForVarOrTmp(), stateToString(), and testsFor().
Referenced by VisitCallExpr(), VisitCXXMemberCallExpr(), and VisitCXXOperatorCallExpr().
|
inline |
Definition at line 521 of file Consumed.cpp.
Referenced by clang::consumed::ConsumedAnalyzer::run().
void ConsumedStmtVisitor::VisitBinaryOperator | ( | const BinaryOperator * | BinOp | ) |
Definition at line 694 of file Consumed.cpp.
References clang::consumed::CS_None, clang::BinaryOperator::getLHS(), clang::BinaryOperator::getOpcode(), and clang::BinaryOperator::getRHS().
void ConsumedStmtVisitor::VisitCallExpr | ( | const CallExpr * | Call | ) |
Definition at line 733 of file Consumed.cpp.
References clang::Call, clang::consumed::CS_Consumed, and handleCall().
void ConsumedStmtVisitor::VisitCastExpr | ( | const CastExpr * | Cast | ) |
Definition at line 749 of file Consumed.cpp.
void ConsumedStmtVisitor::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | Temp | ) |
Definition at line 753 of file Consumed.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr().
void ConsumedStmtVisitor::VisitCXXConstructExpr | ( | const CXXConstructExpr * | Call | ) |
Definition at line 764 of file Consumed.cpp.
References clang::Call, clang::Constructor, clang::consumed::CS_Consumed, clang::consumed::CS_None, clang::consumed::CS_Unknown, isConsumableType(), isSetOnReadPtrType(), mapConsumableAttrState(), and mapReturnTypestateAttrState().
void ConsumedStmtVisitor::VisitCXXMemberCallExpr | ( | const CXXMemberCallExpr * | Call | ) |
Definition at line 795 of file Consumed.cpp.
References clang::Call, and handleCall().
void ConsumedStmtVisitor::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | Call | ) |
Definition at line 805 of file Consumed.cpp.
References clang::Call, and handleCall().
void ConsumedStmtVisitor::VisitDeclRefExpr | ( | const DeclRefExpr * | DeclRef | ) |
Definition at line 825 of file Consumed.cpp.
References clang::consumed::CS_None, and clang::DeclRefExpr::getDecl().
void ConsumedStmtVisitor::VisitDeclStmt | ( | const DeclStmt * | DelcS | ) |
Definition at line 831 of file Consumed.cpp.
References clang::cast(), clang::DeclStmt::decls(), clang::DeclStmt::getSingleDecl(), clang::isa(), clang::DeclStmt::isSingleDecl(), and VisitVarDecl().
void ConsumedStmtVisitor::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | Temp | ) |
Definition at line 841 of file Consumed.cpp.
References clang::MaterializeTemporaryExpr::getSubExpr().
void ConsumedStmtVisitor::VisitMemberExpr | ( | const MemberExpr * | MExpr | ) |
Definition at line 846 of file Consumed.cpp.
References clang::MemberExpr::getBase().
void ConsumedStmtVisitor::VisitParmVarDecl | ( | const ParmVarDecl * | Param | ) |
Definition at line 850 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::CS_Unknown, clang::Type::getPointeeType(), isConsumableType(), clang::Type::isReferenceType(), isRValueRef(), mapConsumableAttrState(), and mapParamTypestateAttrState().
Referenced by clang::consumed::ConsumedAnalyzer::run().
void ConsumedStmtVisitor::VisitReturnStmt | ( | const ReturnStmt * | Ret | ) |
Definition at line 869 of file Consumed.cpp.
References clang::consumed::CS_None, and stateToString().
void ConsumedStmtVisitor::VisitUnaryOperator | ( | const UnaryOperator * | UOp | ) |
Definition at line 889 of file Consumed.cpp.
References clang::UnaryOperator::getOpcode(), and clang::UnaryOperator::getSubExpr().
void ConsumedStmtVisitor::VisitVarDecl | ( | const VarDecl * | Var | ) |
Definition at line 909 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::CS_Unknown, clang::consumed::PropagationInfo::getAsState(), clang::VarDecl::getInit(), clang::ValueDecl::getType(), clang::VarDecl::hasInit(), clang::Expr::IgnoreImplicit(), and isConsumableType().
Referenced by VisitDeclStmt().