]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h
Merge Cavium Octeon SDK 2.0 Simple Executive; this brings some fixes and new
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / AST / OperationKinds.h
1 //===- OperationKinds.h - Operation enums -----------------------*- 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 enumerates the different kinds of operations that can be
11 // performed by various expressions.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_CLANG_AST_OPERATION_KINDS_H
16 #define LLVM_CLANG_AST_OPERATION_KINDS_H
17
18 namespace clang {
19   
20 /// CastKind - the kind of cast this represents.
21 enum CastKind {
22   /// CK_Unknown - Unknown cast kind.
23   /// FIXME: The goal is to get rid of this and make all casts have a
24   /// kind so that the AST client doesn't have to try to figure out what's
25   /// going on.
26   CK_Unknown,
27
28   /// CK_BitCast - Used for reinterpret_cast.
29   CK_BitCast,
30
31   /// CK_LValueBitCast - Used for reinterpret_cast of expressions to
32   /// a reference type.
33   CK_LValueBitCast,
34     
35   /// CK_NoOp - Used for const_cast.
36   CK_NoOp,
37
38   /// CK_BaseToDerived - Base to derived class casts.
39   CK_BaseToDerived,
40
41   /// CK_DerivedToBase - Derived to base class casts.
42   CK_DerivedToBase,
43
44   /// CK_UncheckedDerivedToBase - Derived to base class casts that
45   /// assume that the derived pointer is not null.
46   CK_UncheckedDerivedToBase,
47
48   /// CK_Dynamic - Dynamic cast.
49   CK_Dynamic,
50
51   /// CK_ToUnion - Cast to union (GCC extension).
52   CK_ToUnion,
53
54   /// CK_ArrayToPointerDecay - Array to pointer decay.
55   CK_ArrayToPointerDecay,
56
57   // CK_FunctionToPointerDecay - Function to pointer decay.
58   CK_FunctionToPointerDecay,
59
60   /// CK_NullToMemberPointer - Null pointer to member pointer.
61   CK_NullToMemberPointer,
62
63   /// CK_BaseToDerivedMemberPointer - Member pointer in base class to
64   /// member pointer in derived class.
65   CK_BaseToDerivedMemberPointer,
66
67   /// CK_DerivedToBaseMemberPointer - Member pointer in derived class to
68   /// member pointer in base class.
69   CK_DerivedToBaseMemberPointer,
70     
71   /// CK_UserDefinedConversion - Conversion using a user defined type
72   /// conversion function.
73   CK_UserDefinedConversion,
74
75   /// CK_ConstructorConversion - Conversion by constructor
76   CK_ConstructorConversion,
77     
78   /// CK_IntegralToPointer - Integral to pointer
79   CK_IntegralToPointer,
80     
81   /// CK_PointerToIntegral - Pointer to integral
82   CK_PointerToIntegral,
83     
84   /// CK_ToVoid - Cast to void.
85   CK_ToVoid,
86     
87   /// CK_VectorSplat - Casting from an integer/floating type to an extended
88   /// vector type with the same element type as the src type. Splats the 
89   /// src expression into the destination expression.
90   CK_VectorSplat,
91     
92   /// CK_IntegralCast - Casting between integral types of different size.
93   CK_IntegralCast,
94
95   /// CK_IntegralToFloating - Integral to floating point.
96   CK_IntegralToFloating,
97     
98   /// CK_FloatingToIntegral - Floating point to integral.
99   CK_FloatingToIntegral,
100     
101   /// CK_FloatingCast - Casting between floating types of different size.
102   CK_FloatingCast,
103     
104   /// CK_MemberPointerToBoolean - Member pointer to boolean
105   CK_MemberPointerToBoolean,
106
107   /// CK_AnyPointerToObjCPointerCast - Casting any pointer to objective-c 
108   /// pointer
109   CK_AnyPointerToObjCPointerCast,
110
111   /// CK_AnyPointerToBlockPointerCast - Casting any pointer to block 
112   /// pointer
113   CK_AnyPointerToBlockPointerCast,
114
115   /// \brief Converting between two Objective-C object types, which
116   /// can occur when performing reference binding to an Objective-C
117   /// object.
118   CK_ObjCObjectLValueCast
119 };
120
121
122 enum BinaryOperatorKind {
123   // Operators listed in order of precedence.
124   // Note that additions to this should also update the StmtVisitor class.
125   BO_PtrMemD, BO_PtrMemI,       // [C++ 5.5] Pointer-to-member operators.
126   BO_Mul, BO_Div, BO_Rem,       // [C99 6.5.5] Multiplicative operators.
127   BO_Add, BO_Sub,               // [C99 6.5.6] Additive operators.
128   BO_Shl, BO_Shr,               // [C99 6.5.7] Bitwise shift operators.
129   BO_LT, BO_GT, BO_LE, BO_GE,   // [C99 6.5.8] Relational operators.
130   BO_EQ, BO_NE,                 // [C99 6.5.9] Equality operators.
131   BO_And,                       // [C99 6.5.10] Bitwise AND operator.
132   BO_Xor,                       // [C99 6.5.11] Bitwise XOR operator.
133   BO_Or,                        // [C99 6.5.12] Bitwise OR operator.
134   BO_LAnd,                      // [C99 6.5.13] Logical AND operator.
135   BO_LOr,                       // [C99 6.5.14] Logical OR operator.
136   BO_Assign, BO_MulAssign,      // [C99 6.5.16] Assignment operators.
137   BO_DivAssign, BO_RemAssign,
138   BO_AddAssign, BO_SubAssign,
139   BO_ShlAssign, BO_ShrAssign,
140   BO_AndAssign, BO_XorAssign,
141   BO_OrAssign,
142   BO_Comma                      // [C99 6.5.17] Comma operator.
143 };
144
145 enum UnaryOperatorKind {
146   // Note that additions to this should also update the StmtVisitor class.
147   UO_PostInc, UO_PostDec, // [C99 6.5.2.4] Postfix increment and decrement
148   UO_PreInc, UO_PreDec,   // [C99 6.5.3.1] Prefix increment and decrement
149   UO_AddrOf, UO_Deref,    // [C99 6.5.3.2] Address and indirection
150   UO_Plus, UO_Minus,      // [C99 6.5.3.3] Unary arithmetic
151   UO_Not, UO_LNot,        // [C99 6.5.3.3] Unary arithmetic
152   UO_Real, UO_Imag,       // "__real expr"/"__imag expr" Extension.
153   UO_Extension            // __extension__ marker.
154 };
155
156 }
157
158 #endif