clang  15.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"

Collaboration diagram for clang::OverloadCandidateSet::OperatorRewriteInfo:
Collaboration graph
[legend]

Public Member Functions

 OperatorRewriteInfo ()
 
 OperatorRewriteInfo (OverloadedOperatorKind Op, bool AllowRewritten)
 
bool isRewrittenOperator (const FunctionDecl *FD)
 Would use of this function result in a rewrite using a different operator? More...
 
bool isAcceptableCandidate (const FunctionDecl *FD)
 
OverloadCandidateRewriteKind getRewriteKind (const FunctionDecl *FD, OverloadCandidateParamOrder PO)
 Determine the kind of rewrite that should be performed for this candidate. More...
 
bool isReversible ()
 Determines whether this operator could be implemented by a function with reversed parameter order. More...
 
bool shouldAddReversed (OverloadedOperatorKind Op)
 Determine whether we should consider looking for and adding reversed candidates for operator Op. More...
 
bool shouldAddReversed (ASTContext &Ctx, const FunctionDecl *FD)
 Determine whether we should add a rewritten candidate for FD with reversed parameter order. More...
 

Public Attributes

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

Detailed Description

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

Definition at line 961 of file Overload.h.

Constructor & Destructor Documentation

◆ OperatorRewriteInfo() [1/2]

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

Definition at line 962 of file Overload.h.

◆ OperatorRewriteInfo() [2/2]

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

Definition at line 964 of file Overload.h.

Member Function Documentation

◆ getRewriteKind()

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

Determine the kind of rewrite that should be performed for this candidate.

Definition at line 996 of file Overload.h.

References clang::CRK_DifferentOperator, clang::CRK_None, clang::CRK_Reversed, isRewrittenOperator(), and clang::Reversed.

◆ 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 1007 of file Overload.h.

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

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 974 of file Overload.h.

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

Referenced by getRewriteKind().

◆ shouldAddReversed() [1/2]

bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed ( ASTContext Ctx,
const FunctionDecl FD 
)

◆ shouldAddReversed() [2/2]

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

Determine whether we should consider looking for and adding reversed candidates for operator Op.

Definition at line 887 of file SemaOverload.cpp.

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

Member Data Documentation

◆ AllowRewrittenCandidates

bool clang::OverloadCandidateSet::OperatorRewriteInfo::AllowRewrittenCandidates

Whether we should include rewritten candidates in the overload set.

Definition at line 970 of file Overload.h.

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

◆ OriginalOperator

OverloadedOperatorKind clang::OverloadCandidateSet::OperatorRewriteInfo::OriginalOperator

The original operator as written in the source.

Definition at line 968 of file Overload.h.

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


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