|
clang-tools 22.0.0git
|
Classes | |
| struct | NodeAndBool |
Public Types | |
| using | ExprAndBool = NodeAndBool<Expr> |
| using | DeclAndBool = NodeAndBool<Decl> |
Public Member Functions | |
| Visitor (SimplifyBooleanExprCheck *Check, ASTContext &Context) | |
| bool | traverse () |
| bool | dataTraverseStmtPre (Stmt *S) |
| bool | dataTraverseStmtPost (Stmt *S) |
| bool | VisitBinaryOperator (const BinaryOperator *Op) const |
| Stmt * | parent () const |
| bool | VisitIfStmt (IfStmt *If) |
| bool | VisitConditionalOperator (ConditionalOperator *Cond) |
| bool | VisitCompoundStmt (CompoundStmt *CS) |
| bool | isExpectedUnaryLNot (const Expr *E) |
| bool | isExpectedBinaryOp (const Expr *E) |
| bool | nestedDemorgan (const Expr *E, unsigned NestingLevel) |
| bool | TraverseUnaryOperator (UnaryOperator *Op) |
Static Public Member Functions | |
| static bool | shouldIgnore (Stmt *S) |
| static std::optional< bool > | getAsBoolLiteral (const Expr *E, bool FilterMacro) |
| static ExprAndBool | parseReturnLiteralBool (const Stmt *S) |
| Detect's return (true|false|!true|!false);. | |
| template<typename Functor> | |
| static auto | checkSingleStatement (Stmt *S, Functor F) -> decltype(F(S)) |
If S is not a CompoundStmt, applies F on S, otherwise if there is only 1 statement in the CompoundStmt, applies F on that single statement. | |
| template<typename Functor> | |
| static bool | checkEitherSide (const BinaryOperator *BO, Functor Func) |
Definition at line 258 of file SimplifyBooleanExprCheck.cpp.
Definition at line 328 of file SimplifyBooleanExprCheck.cpp.
Definition at line 327 of file SimplifyBooleanExprCheck.cpp.
|
inline |
Definition at line 262 of file SimplifyBooleanExprCheck.cpp.
References clang::tidy::readability::SimplifyBooleanExprCheck::SimplifyBooleanExprCheck().
|
inlinestatic |
Definition at line 526 of file SimplifyBooleanExprCheck.cpp.
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inlinestatic |
If S is not a CompoundStmt, applies F on S, otherwise if there is only 1 statement in the CompoundStmt, applies F on that single statement.
Definition at line 346 of file SimplifyBooleanExprCheck.cpp.
Referenced by VisitCompoundStmt(), and VisitIfStmt().
|
inline |
Definition at line 289 of file SimplifyBooleanExprCheck.cpp.
References shouldIgnore().
|
inline |
Definition at line 278 of file SimplifyBooleanExprCheck.cpp.
References shouldIgnore().
|
inlinestatic |
Definition at line 303 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
Referenced by getAsBoolLiteral(), parseReturnLiteralBool(), VisitConditionalOperator(), and VisitIfStmt().
|
inline |
Definition at line 519 of file SimplifyBooleanExprCheck.cpp.
Referenced by TraverseUnaryOperator().
|
inline |
Definition at line 514 of file SimplifyBooleanExprCheck.cpp.
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inline |
Definition at line 530 of file SimplifyBooleanExprCheck.cpp.
References checkEitherSide(), isExpectedUnaryLNot(), and nestedDemorgan().
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inline |
Definition at line 355 of file SimplifyBooleanExprCheck.cpp.
Referenced by TraverseUnaryOperator(), and VisitIfStmt().
|
inlinestatic |
Detect's return (true|false|!true|!false);.
Definition at line 331 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
Referenced by VisitCompoundStmt(), and VisitIfStmt().
|
inlinestatic |
Definition at line 267 of file SimplifyBooleanExprCheck.cpp.
Referenced by dataTraverseStmtPost(), and dataTraverseStmtPre().
|
inline |
Definition at line 265 of file SimplifyBooleanExprCheck.cpp.
Referenced by clang::tidy::readability::SimplifyBooleanExprCheck::check().
|
inline |
Definition at line 558 of file SimplifyBooleanExprCheck.cpp.
References checkEitherSide(), isExpectedBinaryOp(), isExpectedUnaryLNot(), nestedDemorgan(), and parent().
|
inline |
Definition at line 297 of file SimplifyBooleanExprCheck.cpp.
|
inline |
Definition at line 455 of file SimplifyBooleanExprCheck.cpp.
References clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >::Bool, checkSingleStatement(), clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >::Item, and parseReturnLiteralBool().
|
inline |
Definition at line 439 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
|
inline |
Definition at line 359 of file SimplifyBooleanExprCheck.cpp.
References clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >::Bool, checkSingleStatement(), getAsBoolLiteral(), clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >::Item, parent(), and parseReturnLiteralBool().