Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/clang/Basic/OperatorKinds.def is written in an unsupported language. File is not indexed.

0001 //===--- OperatorKinds.def - C++ Overloaded Operator Database ---*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines the OverloadedOperator database, which includes
0010 // all of the overloadable C++ operators.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 //
0014 /// @file OperatorKinds.def
0015 ///
0016 /// In this file, each of the overloadable C++ operators is enumerated
0017 /// with either the OVERLOADED_OPERATOR or OVERLOADED_OPERATOR_MULTI
0018 /// macro, each of which can be specified by the code including this
0019 /// file. OVERLOADED_OPERATOR is used for single-token operators
0020 /// (e.g., "+"), and has six arguments:
0021 ///
0022 /// Name: The name of the token. OO_Name will be the name of the
0023 /// corresponding enumerator in OverloadedOperatorKind in
0024 /// OperatorKinds.h.
0025 ///
0026 /// Spelling: A string that provides a canonical spelling for the
0027 /// operator, e.g., "operator+".
0028 ///
0029 /// Token: The name of the token that specifies the operator, e.g.,
0030 /// "plus" for operator+ or "greatergreaterequal" for
0031 /// "operator>>=". With a "kw_" prefix, the token name can be used as
0032 /// an enumerator into the TokenKind enumeration.
0033 ///
0034 /// Unary: True if the operator can be declared as a unary operator.
0035 ///
0036 /// Binary: True if the operator can be declared as a binary
0037 /// operator. Note that some operators (e.g., "operator+" and
0038 /// "operator*") can be both unary and binary.
0039 ///
0040 /// MemberOnly: True if this operator can only be declared as a
0041 /// member function. False if the operator can be both a
0042 /// non-member function and a member function.
0043 ///
0044 /// OVERLOADED_OPERATOR_MULTI is used to enumerate the multi-token
0045 /// overloaded operator names, e.g., "operator delete []". The macro
0046 /// has all of the parameters of OVERLOADED_OPERATOR except Token,
0047 /// which is omitted.
0048 
0049 #ifndef OVERLOADED_OPERATOR
0050 #  define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly)
0051 #endif
0052 
0053 #ifndef OVERLOADED_OPERATOR_MULTI
0054 #  define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) \
0055     OVERLOADED_OPERATOR(Name,Spelling,unknown,Unary,Binary,MemberOnly)
0056 #endif
0057 
0058 OVERLOADED_OPERATOR_MULTI(New            , "new"                      , true , true , false)
0059 OVERLOADED_OPERATOR_MULTI(Delete         , "delete"                   , true , true , false)
0060 OVERLOADED_OPERATOR_MULTI(Array_New      , "new[]"                    , true , true , false)
0061 OVERLOADED_OPERATOR_MULTI(Array_Delete   , "delete[]"                 , true , true , false)
0062 OVERLOADED_OPERATOR(Plus                 , "+"   , plus               , true , true , false)
0063 OVERLOADED_OPERATOR(Minus                , "-"   , minus              , true , true , false)
0064 OVERLOADED_OPERATOR(Star                 , "*"   , star               , true , true , false)
0065 OVERLOADED_OPERATOR(Slash                , "/"   , slash              , false, true , false)
0066 OVERLOADED_OPERATOR(Percent              , "%"   , percent            , false, true , false)
0067 OVERLOADED_OPERATOR(Caret                , "^"   , caret              , false, true , false)
0068 OVERLOADED_OPERATOR(Amp                  , "&"   , amp                , true , true , false)
0069 OVERLOADED_OPERATOR(Pipe                 , "|"   , pipe               , false, true , false)
0070 OVERLOADED_OPERATOR(Tilde                , "~"   , tilde              , true , false, false)
0071 OVERLOADED_OPERATOR(Exclaim              , "!"   , exclaim            , true , false, false)
0072 OVERLOADED_OPERATOR(Equal                , "="   , equal              , false, true , true)
0073 OVERLOADED_OPERATOR(Less                 , "<"   , less               , false, true , false)
0074 OVERLOADED_OPERATOR(Greater              , ">"   , greater            , false, true , false)
0075 OVERLOADED_OPERATOR(PlusEqual            , "+="  , plusequal          , false, true , false)
0076 OVERLOADED_OPERATOR(MinusEqual           , "-="  , minusequal         , false, true , false)
0077 OVERLOADED_OPERATOR(StarEqual            , "*="  , starequal          , false, true , false)
0078 OVERLOADED_OPERATOR(SlashEqual           , "/="  , slashequal         , false, true , false)
0079 OVERLOADED_OPERATOR(PercentEqual         , "%="  , percentequal       , false, true , false)
0080 OVERLOADED_OPERATOR(CaretEqual           , "^="  , caretequal         , false, true , false)
0081 OVERLOADED_OPERATOR(AmpEqual             , "&="  , ampequal           , false, true , false)
0082 OVERLOADED_OPERATOR(PipeEqual            , "|="  , pipeequal          , false, true , false)
0083 OVERLOADED_OPERATOR(LessLess             , "<<"  , lessless           , false, true , false)
0084 OVERLOADED_OPERATOR(GreaterGreater       , ">>"  , greatergreater     , false, true , false)
0085 OVERLOADED_OPERATOR(LessLessEqual        , "<<=" , lesslessequal      , false, true , false)
0086 OVERLOADED_OPERATOR(GreaterGreaterEqual  , ">>=" , greatergreaterequal, false, true , false)
0087 OVERLOADED_OPERATOR(EqualEqual           , "=="  , equalequal         , false, true , false)
0088 OVERLOADED_OPERATOR(ExclaimEqual         , "!="  , exclaimequal       , false, true , false)
0089 OVERLOADED_OPERATOR(LessEqual            , "<="  , lessequal          , false, true , false)
0090 OVERLOADED_OPERATOR(GreaterEqual         , ">="  , greaterequal       , false, true , false)
0091 OVERLOADED_OPERATOR(Spaceship            , "<=>" , spaceship          , false, true , false)
0092 OVERLOADED_OPERATOR(AmpAmp               , "&&"  , ampamp             , false, true , false)
0093 OVERLOADED_OPERATOR(PipePipe             , "||"  , pipepipe           , false, true , false)
0094 OVERLOADED_OPERATOR(PlusPlus             , "++"  , plusplus           , true , true , false)
0095 OVERLOADED_OPERATOR(MinusMinus           , "--"  , minusminus         , true , true , false)
0096 OVERLOADED_OPERATOR(Comma                , ","   , comma              , false, true , false)
0097 OVERLOADED_OPERATOR(ArrowStar            , "->*" , arrowstar          , false, true , false)
0098 OVERLOADED_OPERATOR(Arrow                , "->"  , arrow              , true , false, true)
0099 OVERLOADED_OPERATOR_MULTI(Call           , "()"                       , true , true , true)
0100 OVERLOADED_OPERATOR_MULTI(Subscript      , "[]"                       , false, true , true)
0101 // ?: can *not* be overloaded, but we need the overload
0102 // resolution machinery for it.
0103 OVERLOADED_OPERATOR_MULTI(Conditional    , "?"                        , false, true , false)
0104 OVERLOADED_OPERATOR(Coawait              , "co_await", kw_co_await    , true , false, false)
0105 
0106 #undef OVERLOADED_OPERATOR_MULTI
0107 #undef OVERLOADED_OPERATOR