clang 17.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, 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 977 of file Overload.h.

Constructor & Destructor Documentation

◆ OperatorRewriteInfo() [1/2]

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

Definition at line 978 of file Overload.h.

◆ OperatorRewriteInfo() [2/2]

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

Definition at line 980 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 967 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 1026 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 994 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 990 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 988 of file Overload.h.

◆ OriginalOperator

OverloadedOperatorKind clang::OverloadCandidateSet::OperatorRewriteInfo::OriginalOperator

The original operator as written in the source.

Definition at line 986 of file Overload.h.

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


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