clang 20.0.0git
Public Member Functions | Public Attributes | List of all members
clang::OverloadCandidateSet::OperatorRewriteInfo Struct Reference

Information about operator rewrites to consider when adding operator functions to a candidate set. More...

#include "clang/Sema/Overload.h"

Public Member Functions

 OperatorRewriteInfo ()
 
 OperatorRewriteInfo (OverloadedOperatorKind Op, SourceLocation OpLoc, bool AllowRewritten)
 
bool isRewrittenOperator (const FunctionDecl *FD)
 Would use of this function result in a rewrite using a different operator?
 
bool isAcceptableCandidate (const FunctionDecl *FD)
 
OverloadCandidateRewriteKind getRewriteKind (const FunctionDecl *FD, OverloadCandidateParamOrder PO)
 Determine the kind of rewrite that should be performed for this candidate.
 
bool isReversible ()
 Determines whether this operator could be implemented by a function with reversed parameter order.
 
bool allowsReversed (OverloadedOperatorKind Op)
 Determine whether reversing parameter order is allowed for operator Op.
 
bool shouldAddReversed (Sema &S, ArrayRef< Expr * > OriginalArgs, FunctionDecl *FD)
 Determine whether we should add a rewritten candidate for FD with reversed parameter order.
 

Public Attributes

OverloadedOperatorKind OriginalOperator
 The original operator as written in the source.
 
SourceLocation OpLoc
 The source location of the operator.
 
bool AllowRewrittenCandidates
 Whether we should include rewritten candidates in the overload set.
 

Detailed Description

Information about operator rewrites to consider when adding operator functions to a candidate set.

Definition at line 1038 of file Overload.h.

Constructor & Destructor Documentation

◆ OperatorRewriteInfo() [1/2]

clang::OverloadCandidateSet::OperatorRewriteInfo::OperatorRewriteInfo ( )
inline

Definition at line 1039 of file Overload.h.

◆ OperatorRewriteInfo() [2/2]

clang::OverloadCandidateSet::OperatorRewriteInfo::OperatorRewriteInfo ( OverloadedOperatorKind  Op,
SourceLocation  OpLoc,
bool  AllowRewritten 
)
inline

Definition at line 1041 of file Overload.h.

Member Function Documentation

◆ allowsReversed()

bool OverloadCandidateSet::OperatorRewriteInfo::allowsReversed ( OverloadedOperatorKind  Op)

Determine whether reversing parameter order is allowed for operator Op.

Definition at line 1058 of file SemaOverload.cpp.

References AllowRewrittenCandidates.

Referenced by isReversible(), and clang::Sema::LookupOverloadedBinOp().

◆ getRewriteKind()

OverloadCandidateRewriteKind clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind ( const FunctionDecl FD,
OverloadCandidateParamOrder  PO 
)
inline

◆ isAcceptableCandidate()

bool clang::OverloadCandidateSet::OperatorRewriteInfo::isAcceptableCandidate ( const FunctionDecl FD)
inline

◆ isReversible()

bool clang::OverloadCandidateSet::OperatorRewriteInfo::isReversible ( )
inline

Determines whether this operator could be implemented by a function with reversed parameter order.

Definition at line 1087 of file Overload.h.

References AllowRewrittenCandidates, allowsReversed(), clang::getRewrittenOverloadedOperator(), clang::OO_None, and OriginalOperator.

Referenced by clang::Sema::CreateOverloadedBinOp().

◆ isRewrittenOperator()

bool clang::OverloadCandidateSet::OperatorRewriteInfo::isRewrittenOperator ( const FunctionDecl FD)
inline

Would use of this function result in a rewrite using a different operator?

Definition at line 1055 of file Overload.h.

References clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), and OriginalOperator.

Referenced by getRewriteKind().

◆ shouldAddReversed()

bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed ( Sema S,
ArrayRef< Expr * >  OriginalArgs,
FunctionDecl FD 
)

Member Data Documentation

◆ AllowRewrittenCandidates

bool clang::OverloadCandidateSet::OperatorRewriteInfo::AllowRewrittenCandidates

Whether we should include rewritten candidates in the overload set.

Definition at line 1051 of file Overload.h.

Referenced by allowsReversed(), isAcceptableCandidate(), isReversible(), and clang::Sema::LookupOverloadedBinOp().

◆ OpLoc

SourceLocation clang::OverloadCandidateSet::OperatorRewriteInfo::OpLoc

The source location of the operator.

Definition at line 1049 of file Overload.h.

◆ OriginalOperator

OverloadedOperatorKind clang::OverloadCandidateSet::OperatorRewriteInfo::OriginalOperator

The original operator as written in the source.

Definition at line 1047 of file Overload.h.

Referenced by isAcceptableCandidate(), isReversible(), and isRewrittenOperator().


The documentation for this struct was generated from the following files: