clang-tools 20.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 261 of file SimplifyBooleanExprCheck.cpp.
Definition at line 331 of file SimplifyBooleanExprCheck.cpp.
Definition at line 330 of file SimplifyBooleanExprCheck.cpp.
|
inline |
Definition at line 265 of file SimplifyBooleanExprCheck.cpp.
|
inlinestatic |
Definition at line 529 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 349 of file SimplifyBooleanExprCheck.cpp.
Referenced by VisitCompoundStmt(), and VisitIfStmt().
|
inline |
Definition at line 292 of file SimplifyBooleanExprCheck.cpp.
References shouldIgnore().
|
inline |
Definition at line 281 of file SimplifyBooleanExprCheck.cpp.
References shouldIgnore().
|
inlinestatic |
Definition at line 306 of file SimplifyBooleanExprCheck.cpp.
References E, and getAsBoolLiteral().
Referenced by getAsBoolLiteral(), parseReturnLiteralBool(), VisitConditionalOperator(), and VisitIfStmt().
|
inline |
Definition at line 522 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by TraverseUnaryOperator().
|
inline |
Definition at line 517 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inline |
Definition at line 533 of file SimplifyBooleanExprCheck.cpp.
References checkEitherSide(), E, isExpectedUnaryLNot(), and nestedDemorgan().
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inline |
Definition at line 358 of file SimplifyBooleanExprCheck.cpp.
Referenced by TraverseUnaryOperator(), and VisitIfStmt().
|
inlinestatic |
Detect's return (true|false|!true|!false);.
Definition at line 334 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
Referenced by VisitCompoundStmt(), and VisitIfStmt().
|
inlinestatic |
Definition at line 270 of file SimplifyBooleanExprCheck.cpp.
Referenced by dataTraverseStmtPost(), and dataTraverseStmtPre().
|
inline |
Definition at line 268 of file SimplifyBooleanExprCheck.cpp.
Referenced by clang::tidy::readability::SimplifyBooleanExprCheck::check().
|
inline |
Definition at line 561 of file SimplifyBooleanExprCheck.cpp.
References clang::tidy::ClangTidyCheck::areDiagsSelfContained(), checkEitherSide(), E, isExpectedBinaryOp(), isExpectedUnaryLNot(), nestedDemorgan(), and parent().
|
inline |
Definition at line 300 of file SimplifyBooleanExprCheck.cpp.
|
inline |
Definition at line 458 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 442 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
|
inline |
Definition at line 362 of file SimplifyBooleanExprCheck.cpp.
References clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >::Bool, checkSingleStatement(), getAsBoolLiteral(), clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >::Item, Loc, parent(), and parseReturnLiteralBool().