clang-tools 18.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 | 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. | |
static bool | isUnaryLNot (const Expr *E) |
template<typename Functor > | |
static bool | checkEitherSide (const BinaryOperator *BO, Functor Func) |
static bool | nestedDemorgan (const Expr *E, unsigned NestingLevel) |
Definition at line 259 of file SimplifyBooleanExprCheck.cpp.
Definition at line 324 of file SimplifyBooleanExprCheck.cpp.
Definition at line 323 of file SimplifyBooleanExprCheck.cpp.
|
inline |
Definition at line 263 of file SimplifyBooleanExprCheck.cpp.
|
inlinestatic |
Definition at line 516 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 342 of file SimplifyBooleanExprCheck.cpp.
Referenced by VisitCompoundStmt(), and VisitIfStmt().
|
inline |
Definition at line 285 of file SimplifyBooleanExprCheck.cpp.
References shouldIgnore().
|
inline |
Definition at line 279 of file SimplifyBooleanExprCheck.cpp.
References shouldIgnore().
|
inlinestatic |
Definition at line 299 of file SimplifyBooleanExprCheck.cpp.
References E, and getAsBoolLiteral().
Referenced by getAsBoolLiteral(), parseReturnLiteralBool(), VisitConditionalOperator(), and VisitIfStmt().
|
inlinestatic |
Definition at line 510 of file SimplifyBooleanExprCheck.cpp.
References E.
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inlinestatic |
Definition at line 520 of file SimplifyBooleanExprCheck.cpp.
References checkEitherSide(), E, isUnaryLNot(), and nestedDemorgan().
Referenced by nestedDemorgan(), and TraverseUnaryOperator().
|
inline |
Definition at line 351 of file SimplifyBooleanExprCheck.cpp.
Referenced by TraverseUnaryOperator(), and VisitIfStmt().
|
inlinestatic |
Detect's return (true|false|!true|!false);.
Definition at line 327 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
Referenced by VisitCompoundStmt(), and VisitIfStmt().
|
inlinestatic |
Definition at line 268 of file SimplifyBooleanExprCheck.cpp.
Referenced by dataTraverseStmtPost(), and dataTraverseStmtPre().
|
inline |
Definition at line 266 of file SimplifyBooleanExprCheck.cpp.
Referenced by clang::tidy::readability::SimplifyBooleanExprCheck::check().
|
inline |
Definition at line 550 of file SimplifyBooleanExprCheck.cpp.
References clang::tidy::ClangTidyCheck::areDiagsSelfContained(), checkEitherSide(), E, isUnaryLNot(), nestedDemorgan(), and parent().
|
inline |
Definition at line 293 of file SimplifyBooleanExprCheck.cpp.
|
inline |
Definition at line 451 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 435 of file SimplifyBooleanExprCheck.cpp.
References getAsBoolLiteral().
|
inline |
Definition at line 355 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().