clang-tools 20.0.0git
Classes | Namespaces | Functions | Variables
SimplifyBooleanExprCheck.cpp File Reference
#include "SimplifyBooleanExprCheck.h"
#include "clang/AST/Expr.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Support/SaveAndRestore.h"
#include <optional>
#include <string>
#include <utility>

Go to the source code of this file.

Classes

class  clang::tidy::readability::SimplifyBooleanExprCheck::Visitor
 
struct  clang::tidy::readability::SimplifyBooleanExprCheck::Visitor::NodeAndBool< Node >
 

Namespaces

namespace  clang
 ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
 
namespace  clang::tidy
 
namespace  clang::tidy::readability
 

Functions

static bool clang::tidy::readability::needsParensAfterUnaryNegation (const Expr *E)
 
static StringRef clang::tidy::readability::negatedOperator (const BinaryOperator *BinOp)
 
static StringRef clang::tidy::readability::getOperatorName (OverloadedOperatorKind OpKind)
 
static StringRef clang::tidy::readability::negatedOperator (const CXXOperatorCallExpr *OpCall)
 
static std::string clang::tidy::readability::asBool (StringRef Text, bool NeedsStaticCast)
 
static bool clang::tidy::readability::needsNullPtrComparison (const Expr *E)
 
static bool clang::tidy::readability::needsZeroComparison (const Expr *E)
 
static bool clang::tidy::readability::needsStaticCast (const Expr *E)
 
static std::string clang::tidy::readability::compareExpressionToConstant (const ASTContext &Context, const Expr *E, bool Negated, const char *Constant)
 
static std::string clang::tidy::readability::compareExpressionToNullPtr (const ASTContext &Context, const Expr *E, bool Negated)
 
static std::string clang::tidy::readability::compareExpressionToZero (const ASTContext &Context, const Expr *E, bool Negated)
 
static std::string clang::tidy::readability::replacementExpression (const ASTContext &Context, bool Negated, const Expr *E)
 
static bool clang::tidy::readability::containsDiscardedTokens (const ASTContext &Context, CharSourceRange CharRange)
 
static bool clang::tidy::readability::containsBoolLiteral (const Expr *E)
 
static bool clang::tidy::readability::flipDemorganOperator (llvm::SmallVectorImpl< FixItHint > &Output, const BinaryOperator *BO)
 Swaps a BinaryOperator opcode from && to || or vice-versa.
 
static BinaryOperatorKind clang::tidy::readability::getDemorganFlippedOperator (BinaryOperatorKind BO)
 
static bool clang::tidy::readability::flipDemorganSide (SmallVectorImpl< FixItHint > &Fixes, const ASTContext &Ctx, const Expr *E, std::optional< BinaryOperatorKind > OuterBO)
 
static bool clang::tidy::readability::flipDemorganBinaryOperator (SmallVectorImpl< FixItHint > &Fixes, const ASTContext &Ctx, const BinaryOperator *BinOp, std::optional< BinaryOperatorKind > OuterBO, const ParenExpr *Parens=nullptr)
 Inverts BinOp, Removing Parens if they exist and are safe to remove.
 
static bool clang::tidy::readability::shouldRemoveParens (const Stmt *Parent, BinaryOperatorKind NewOuterBinary, const ParenExpr *Parens)
 

Variables

static constexpr char clang::tidy::readability::SimplifyOperatorDiagnostic []
 
static constexpr char clang::tidy::readability::SimplifyConditionDiagnostic []
 
static constexpr char clang::tidy::readability::SimplifyConditionalReturnDiagnostic []
 
static std::pair< BinaryOperatorKind, BinaryOperatorKind > clang::tidy::readability::Opposites []
 
static std::pair< OverloadedOperatorKind, StringRef > clang::tidy::readability::OperatorNames []
 
static std::pair< OverloadedOperatorKind, OverloadedOperatorKind > clang::tidy::readability::OppositeOverloads []