class CXXRewrittenBinaryOperator

Declaration

class CXXRewrittenBinaryOperator : public Expr { /* full declaration omitted */ };

Description

A rewritten comparison expression that was originally written using operator syntax. In C++20, the following rewrites are performed: - a == b -> b == a - a != b -> !(a == b) - a != b -> !(b == a) - For \c \ in \c <, \c <=, \c >, \c >=, \c <=>: - a @ b -> (a < => b) @ 0 - a @ b -> 0 @ (b < => a) This expression provides access to both the original syntax and the rewritten expression. Note that the rewritten calls to \c ==, \c <=>, and \c \ are typically\c CXXOperatorCallExprs, but could theoretically be \c BinaryOperators.

Declared at: clang/include/clang/AST/ExprCXX.h:284

Inherits from: Expr

Member Variables

private clang::Stmt* SemanticForm
The rewritten semantic form.

Inherited from Stmt:

protected

Method Overview

Inherited from Expr:

Inherited from ValueStmt:

Inherited from Stmt:

Methods

CXXRewrittenBinaryOperator(
    clang::Stmt::EmptyShell Empty)

Declared at: clang/include/clang/AST/ExprCXX.h:298

Parameters

clang::Stmt::EmptyShell Empty

CXXRewrittenBinaryOperator(
    clang::Expr* SemanticForm,
    bool IsReversed)

Declared at: clang/include/clang/AST/ExprCXX.h:291

Parameters

clang::Expr* SemanticForm
bool IsReversed

clang::Stmt::child_range children()

Declared at: clang/include/clang/AST/ExprCXX.h:357

static bool classof(const clang::Stmt* T)

Declared at: clang/include/clang/AST/ExprCXX.h:361

Parameters

const clang::Stmt* T

clang::SourceLocation getBeginLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:345

clang::CXXRewrittenBinaryOperator::DecomposedForm
getDecomposedForm() const

Description

Decompose this operator into its syntactic form.

Declared at: clang/include/clang/AST/ExprCXX.h:317

clang::SourceLocation getEndLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:348

clang::SourceLocation getExprLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:339

const clang::Expr* getLHS() const

Declared at: clang/include/clang/AST/ExprCXX.h:333

clang::BinaryOperatorKind getOpcode() const

Declared at: clang/include/clang/AST/ExprCXX.h:323

static llvm::StringRef getOpcodeStr(
    clang::BinaryOperatorKind Op)

Declared at: clang/include/clang/AST/ExprCXX.h:324

Parameters

clang::BinaryOperatorKind Op

llvm::StringRef getOpcodeStr() const

Declared at: clang/include/clang/AST/ExprCXX.h:327

clang::BinaryOperatorKind getOperator() const

Declared at: clang/include/clang/AST/ExprCXX.h:322

clang::SourceLocation getOperatorLoc() const

Declared at: clang/include/clang/AST/ExprCXX.h:336

const clang::Expr* getRHS() const

Declared at: clang/include/clang/AST/ExprCXX.h:334

clang::Expr* getSemanticForm()

Description

Get an equivalent semantic form for this expression.

Declared at: clang/include/clang/AST/ExprCXX.h:302

const clang::Expr* getSemanticForm() const

Declared at: clang/include/clang/AST/ExprCXX.h:303

clang::SourceRange getSourceRange() const

Declared at: clang/include/clang/AST/ExprCXX.h:351

bool isAssignmentOp() const

Declared at: clang/include/clang/AST/ExprCXX.h:331

bool isComparisonOp() const

Declared at: clang/include/clang/AST/ExprCXX.h:330

bool isReversed() const

Description

Determine whether this expression was rewritten in reverse form.

Declared at: clang/include/clang/AST/ExprCXX.h:320