 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
0.0% |
0 / 0 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
0.0% |
0 / 0 |
| |
|
Line Coverage: |
97.7% |
42 / 43 |
| |
 |
|
 |
1 : //===--- OperatorKinds.def - C++ Overloaded Operator Database ---*- C++ -*-===//
2 : //
3 : // The LLVM Compiler Infrastructure
4 : //
5 : // This file is distributed under the University of Illinois Open Source
6 : // License. See LICENSE.TXT for details.
7 : //
8 : //===----------------------------------------------------------------------===//
9 : //
10 : // This file defines the OverloadedOperator database, which includes
11 : // all of the overloadable C++ operators.
12 : //
13 : //===----------------------------------------------------------------------===//
14 : //
15 : /// @file OperatorKinds.def
16 : ///
17 : /// In this file, each of the overloadable C++ operators is enumerated
18 : /// with either the OVERLOADED_OPERATOR or OVERLOADED_OPERATOR_MULTI
19 : /// macro, each of which can be specified by the code including this
20 : /// file. OVERLOADED_OPERATOR is used for single-token operators
21 : /// (e.g., "+"), and has six arguments:
22 : ///
23 : /// Name: The name of the token. OO_Name will be the name of the
24 : /// corresponding enumerator in OverloadedOperatorKind in
25 : /// OperatorKinds.h.
26 : ///
27 : /// Spelling: A string that provides a canonical spelling for the
28 : /// operator, e.g., "operator+".
29 : ///
30 : /// Token: The name of the token that specifies the operator, e.g.,
31 : /// "plus" for operator+ or "greatergreaterequal" for
32 : /// "operator>>=". With a "kw_" prefix, the token name can be used as
33 : /// an enumerator into the TokenKind enumeration.
34 : ///
35 : /// Unary: True if the operator can be declared as a unary operator.
36 : ///
37 : /// Binary: True if the operator can be declared as a binary
38 : /// operator. Note that some operators (e.g., "operator+" and
39 : /// "operator*") can be both unary and binary.
40 : ///
41 : /// MemberOnly: True if this operator can only be declared as a
42 : /// non-static member function. False if the operator can be both a
43 : /// non-member function and a non-static member function.
44 : ///
45 : /// OVERLOADED_OPERATOR_MULTI is used to enumerate the multi-token
46 : /// overloaded operator names, e.g., "operator delete []". The macro
47 : /// has all of the parameters of OVERLOADED_OPERATOR except Token,
48 : /// which is omitted.
49 :
50 : #ifndef OVERLOADED_OPERATOR
51 : # define OVERLOADED_OPERATOR(Name,Spelling,Token,Unary,Binary,MemberOnly)
52 : #endif
53 :
54 : #ifndef OVERLOADED_OPERATOR_MULTI
55 : # define OVERLOADED_OPERATOR_MULTI(Name,Spelling,Unary,Binary,MemberOnly) \
56 : OVERLOADED_OPERATOR(Name,Spelling,unknown,Unary,Binary,MemberOnly)
57 : #endif
58 :
59 1: OVERLOADED_OPERATOR_MULTI(New , "new" , true , true , false)
60 1: OVERLOADED_OPERATOR_MULTI(Delete , "delete" , true , true , false)
61 1: OVERLOADED_OPERATOR_MULTI(Array_New , "new[]" , true , true , false)
62 1: OVERLOADED_OPERATOR_MULTI(Array_Delete , "delete[]" , true , true , false)
63 53: OVERLOADED_OPERATOR(Plus , "+" , plus , true , true , false)
64 12: OVERLOADED_OPERATOR(Minus , "-" , minus , true , true , false)
65 9: OVERLOADED_OPERATOR(Star , "*" , star , true , true , false)
66 3: OVERLOADED_OPERATOR(Slash , "/" , slash , false, true , false)
67 2: OVERLOADED_OPERATOR(Percent , "%" , percent , false, true , false)
68 1: OVERLOADED_OPERATOR(Caret , "^" , caret , false, true , false)
69 4: OVERLOADED_OPERATOR(Amp , "&" , amp , true , true , false)
70 3: OVERLOADED_OPERATOR(Pipe , "|" , pipe , false, true , false)
71 1: OVERLOADED_OPERATOR(Tilde , "~" , tilde , true , false, false)
72 4: OVERLOADED_OPERATOR(Exclaim , "!" , exclaim , true , false, false)
73 39: OVERLOADED_OPERATOR(Equal , "=" , equal , false, true , true)
74 1: OVERLOADED_OPERATOR(Less , "<" , less , false, true , false)
75 1: OVERLOADED_OPERATOR(Greater , ">" , greater , false, true , false)
76 9: OVERLOADED_OPERATOR(PlusEqual , "+=" , plusequal , false, true , false)
77 1: OVERLOADED_OPERATOR(MinusEqual , "-=" , minusequal , false, true , false)
78 1: OVERLOADED_OPERATOR(StarEqual , "*=" , starequal , false, true , false)
79 1: OVERLOADED_OPERATOR(SlashEqual , "/=" , slashequal , false, true , false)
80 1: OVERLOADED_OPERATOR(PercentEqual , "%=" , percentequal , false, true , false)
81 1: OVERLOADED_OPERATOR(CaretEqual , "^=" , caretequal , false, true , false)
82 1: OVERLOADED_OPERATOR(AmpEqual , "&=" , ampequal , false, true , false)
83 1: OVERLOADED_OPERATOR(PipeEqual , "|=" , pipeequal , false, true , false)
84 4: OVERLOADED_OPERATOR(LessLess , "<<" , lessless , false, true , false)
85 1: OVERLOADED_OPERATOR(GreaterGreater , ">>" , greatergreater , false, true , false)
86 1: OVERLOADED_OPERATOR(LessLessEqual , "<<=" , lesslessequal , false, true , false)
87 1: OVERLOADED_OPERATOR(GreaterGreaterEqual , ">>=" , greatergreaterequal, false, true , false)
88 28: OVERLOADED_OPERATOR(EqualEqual , "==" , equalequal , false, true , false)
89 8: OVERLOADED_OPERATOR(ExclaimEqual , "!=" , exclaimequal , false, true , false)
90 1: OVERLOADED_OPERATOR(LessEqual , "<=" , lessequal , false, true , false)
91 1: OVERLOADED_OPERATOR(GreaterEqual , ">=" , greaterequal , false, true , false)
92 1: OVERLOADED_OPERATOR(AmpAmp , "&&" , ampamp , false, true , false)
93 1: OVERLOADED_OPERATOR(PipePipe , "||" , pipepipe , false, true , false)
94 13: OVERLOADED_OPERATOR(PlusPlus , "++" , plusplus , true , true , false)
95 6: OVERLOADED_OPERATOR(MinusMinus , "--" , minusminus , true , true , false)
96 2: OVERLOADED_OPERATOR(Comma , "," , comma , false, true , false)
97 2: OVERLOADED_OPERATOR(ArrowStar , "->*" , arrowstar , false, true , false)
98 15: OVERLOADED_OPERATOR(Arrow , "->" , arrow , true , false, true)
99 1: OVERLOADED_OPERATOR_MULTI(Call , "()" , true , true , true)
100 1: OVERLOADED_OPERATOR_MULTI(Subscript , "[]" , false, true , true)
101 : // ?: can *not* be overloaded, but we need the overload
102 : // resolution machinery for it.
103 0: OVERLOADED_OPERATOR_MULTI(Conditional , "?" , false, true , false)
104 :
105 : #undef OVERLOADED_OPERATOR_MULTI
106 : #undef OVERLOADED_OPERATOR
Generated: 2010-02-10 01:31 by zcov