1 //===--- OperatorKinds.h - C++ Overloaded Operators -------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// Defines an enumeration for C++ overloaded operators.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_BASIC_OPERATORKINDS_H
15 #define LLVM_CLANG_BASIC_OPERATORKINDS_H
19 /// Enumeration specifying the different kinds of C++ overloaded
21 enum OverloadedOperatorKind : int {
22 OO_None, ///< Not an overloaded operator
23 #define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly) \
25 #include "clang/Basic/OperatorKinds.def"
26 NUM_OVERLOADED_OPERATORS
29 /// Retrieve the spelling of the given overloaded operator, without
30 /// the preceding "operator" keyword.
31 const char *getOperatorSpelling(OverloadedOperatorKind Operator);
33 /// Get the other overloaded operator that the given operator can be rewritten
34 /// into, if any such operator exists.
35 inline OverloadedOperatorKind
36 getRewrittenOverloadedOperator(OverloadedOperatorKind Kind) {
52 } // end namespace clang