clang 20.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< Ptr, ImplClass, RetTy, ParamTys > | |
RetTy | 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) RetTy VisitStmt(PTR(Stmt) Node | |
Additional Inherited Members | |
Public Attributes inherited from clang::StmtVisitorBase< Ptr, ImplClass, RetTy, ParamTys > | |
ParamTys | P { return RetTy() |
Definition at line 455 of file Consumed.cpp.
|
inline |
Definition at line 512 of file Consumed.cpp.
void ConsumedStmtVisitor::checkCallability | ( | const PropagationInfo & | PInfo, |
const FunctionDecl * | FunDecl, | ||
SourceLocation | BlameLoc | ||
) |
Definition at line 575 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::PropagationInfo::getAsState(), clang::Decl::getAttr(), clang::NamedDecl::getNameAsString(), clang::consumed::ConsumedStateMap::getState(), clang::consumed::PropagationInfo::getVar(), isCallableInState(), clang::consumed::PropagationInfo::isTest(), clang::consumed::PropagationInfo::isVar(), stateToString(), clang::consumed::ConsumedAnalyzer::WarningsHandler, clang::consumed::ConsumedWarningsHandlerBase::warnUseInInvalidState(), and clang::consumed::ConsumedWarningsHandlerBase::warnUseOfTempInInvalidState().
Referenced by handleCall(), and clang::consumed::ConsumedAnalyzer::run().
|
inline |
Definition at line 515 of file Consumed.cpp.
bool ConsumedStmtVisitor::handleCall | ( | const CallExpr * | Call, |
const Expr * | ObjArg, | ||
const FunctionDecl * | FunD | ||
) |
Definition at line 607 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::ValueDecl::getType(), clang::consumed::PropagationInfo::getVar(), clang::QualType::isConstQualified(), isConsumableType(), clang::Type::isPointerOrReferenceType(), isRValueRef(), isSetOnReadPtrType(), isTestingFunction(), clang::consumed::PropagationInfo::isTmp(), clang::consumed::PropagationInfo::isVar(), mapParamTypestateAttrState(), mapReturnTypestateAttrState(), mapSetTypestateAttrState(), clang::consumed::ConsumedStateMap::setState(), setStateForVarOrTmp(), stateToString(), testsFor(), clang::consumed::ConsumedAnalyzer::WarningsHandler, and clang::consumed::ConsumedWarningsHandlerBase::warnParamTypestateMismatch().
Referenced by VisitCallExpr(), VisitCXXMemberCallExpr(), and VisitCXXOperatorCallExpr().
|
inline |
Definition at line 524 of file Consumed.cpp.
Referenced by clang::consumed::ConsumedAnalyzer::run().
void ConsumedStmtVisitor::VisitBinaryOperator | ( | const BinaryOperator * | BinOp | ) |
Definition at line 697 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 736 of file Consumed.cpp.
References clang::Call, clang::consumed::CS_Consumed, and handleCall().
void ConsumedStmtVisitor::VisitCastExpr | ( | const CastExpr * | Cast | ) |
Definition at line 752 of file Consumed.cpp.
void ConsumedStmtVisitor::VisitCXXBindTemporaryExpr | ( | const CXXBindTemporaryExpr * | Temp | ) |
Definition at line 756 of file Consumed.cpp.
References clang::CXXBindTemporaryExpr::getSubExpr(), and clang::consumed::ConsumedStateMap::setState().
void ConsumedStmtVisitor::VisitCXXConstructExpr | ( | const CXXConstructExpr * | Call | ) |
Definition at line 767 of file Consumed.cpp.
References clang::Call, 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 798 of file Consumed.cpp.
References clang::Call, and handleCall().
void ConsumedStmtVisitor::VisitCXXOperatorCallExpr | ( | const CXXOperatorCallExpr * | Call | ) |
Definition at line 808 of file Consumed.cpp.
References clang::Call, and handleCall().
void ConsumedStmtVisitor::VisitDeclRefExpr | ( | const DeclRefExpr * | DeclRef | ) |
Definition at line 828 of file Consumed.cpp.
References clang::consumed::CS_None, clang::DeclRefExpr::getDecl(), and clang::consumed::ConsumedStateMap::getState().
void ConsumedStmtVisitor::VisitDeclStmt | ( | const DeclStmt * | DelcS | ) |
Definition at line 834 of file Consumed.cpp.
References clang::DeclStmt::decls(), clang::DeclStmt::getSingleDecl(), clang::DeclStmt::isSingleDecl(), and VisitVarDecl().
void ConsumedStmtVisitor::VisitMaterializeTemporaryExpr | ( | const MaterializeTemporaryExpr * | Temp | ) |
Definition at line 844 of file Consumed.cpp.
References clang::MaterializeTemporaryExpr::getSubExpr().
void ConsumedStmtVisitor::VisitMemberExpr | ( | const MemberExpr * | MExpr | ) |
Definition at line 849 of file Consumed.cpp.
References clang::MemberExpr::getBase().
void ConsumedStmtVisitor::VisitParmVarDecl | ( | const ParmVarDecl * | Param | ) |
Definition at line 853 of file Consumed.cpp.
References clang::consumed::CS_None, clang::consumed::CS_Unknown, clang::Decl::getAttr(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), isConsumableType(), clang::Type::isReferenceType(), isRValueRef(), mapConsumableAttrState(), mapParamTypestateAttrState(), and clang::consumed::ConsumedStateMap::setState().
Referenced by clang::consumed::ConsumedAnalyzer::run().
void ConsumedStmtVisitor::VisitReturnStmt | ( | const ReturnStmt * | Ret | ) |
Definition at line 872 of file Consumed.cpp.
References clang::consumed::ConsumedStateMap::checkParamsForReturnTypestate(), clang::consumed::CS_None, clang::consumed::ConsumedAnalyzer::getExpectedReturnState(), stateToString(), clang::consumed::ConsumedAnalyzer::WarningsHandler, and clang::consumed::ConsumedWarningsHandlerBase::warnReturnTypestateMismatch().
void ConsumedStmtVisitor::VisitUnaryOperator | ( | const UnaryOperator * | UOp | ) |
Definition at line 892 of file Consumed.cpp.
References clang::UnaryOperator::getOpcode(), and clang::UnaryOperator::getSubExpr().
void ConsumedStmtVisitor::VisitVarDecl | ( | const VarDecl * | Var | ) |
Definition at line 912 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(), isConsumableType(), and clang::consumed::ConsumedStateMap::setState().
Referenced by VisitDeclStmt().