clang 20.0.0git
|
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. | |
Information about operator rewrites to consider when adding operator functions to a candidate set.
Definition at line 1038 of file Overload.h.
|
inline |
Definition at line 1039 of file Overload.h.
|
inline |
Definition at line 1041 of file Overload.h.
bool OverloadCandidateSet::OperatorRewriteInfo::allowsReversed | ( | OverloadedOperatorKind | Op | ) |
Determine whether reversing parameter order is allowed for operator Op.
Definition at line 1084 of file SemaOverload.cpp.
References AllowRewrittenCandidates.
Referenced by isReversible(), and clang::Sema::LookupOverloadedBinOp().
|
inline |
Determine the kind of rewrite that should be performed for this candidate.
Definition at line 1077 of file Overload.h.
References clang::CRK_DifferentOperator, clang::CRK_None, clang::CRK_Reversed, isRewrittenOperator(), and clang::Reversed.
Referenced by clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddOverloadCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
|
inline |
Definition at line 1060 of file Overload.h.
References AllowRewrittenCandidates, clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::getRewrittenOverloadedOperator(), and OriginalOperator.
Referenced by clang::Sema::AddNonMemberOperatorCandidates().
|
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().
|
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().
bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed | ( | Sema & | S, |
ArrayRef< Expr * > | OriginalArgs, | ||
FunctionDecl * | FD | ||
) |
Determine whether we should add a rewritten candidate for FD
with reversed parameter order.
OriginalArgs | are the original non reversed arguments. |
Definition at line 1091 of file SemaOverload.cpp.
References clang::Sema::Context, clang::FunctionDecl::getNumNonObjectParams(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::ASTContext::hasSameUnqualifiedType(), and shouldAddReversedEqEq().
Referenced by clang::Sema::AddArgumentDependentLookupCandidates(), clang::Sema::AddMemberOperatorCandidates(), and clang::Sema::AddNonMemberOperatorCandidates().
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().
SourceLocation clang::OverloadCandidateSet::OperatorRewriteInfo::OpLoc |
The source location of the operator.
Definition at line 1049 of file Overload.h.
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().