1 //===- OperationKinds.h - Operation enums -----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file enumerates the different kinds of operations that can be
11 // performed by various expressions.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_AST_OPERATION_KINDS_H
16 #define LLVM_CLANG_AST_OPERATION_KINDS_H
20 /// CastKind - the kind of cast this represents.
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
28 /// CK_BitCast - Used for reinterpret_cast.
31 /// CK_LValueBitCast - Used for reinterpret_cast of expressions to
35 /// CK_NoOp - Used for const_cast.
38 /// CK_BaseToDerived - Base to derived class casts.
41 /// CK_DerivedToBase - Derived to base class casts.
44 /// CK_UncheckedDerivedToBase - Derived to base class casts that
45 /// assume that the derived pointer is not null.
46 CK_UncheckedDerivedToBase,
48 /// CK_Dynamic - Dynamic cast.
51 /// CK_ToUnion - Cast to union (GCC extension).
54 /// CK_ArrayToPointerDecay - Array to pointer decay.
55 CK_ArrayToPointerDecay,
57 /// CK_FunctionToPointerDecay - Function to pointer decay.
58 CK_FunctionToPointerDecay,
60 /// CK_NullToMemberPointer - Null pointer to member pointer.
61 CK_NullToMemberPointer,
63 /// CK_BaseToDerivedMemberPointer - Member pointer in base class to
64 /// member pointer in derived class.
65 CK_BaseToDerivedMemberPointer,
67 /// CK_DerivedToBaseMemberPointer - Member pointer in derived class to
68 /// member pointer in base class.
69 CK_DerivedToBaseMemberPointer,
71 /// CK_UserDefinedConversion - Conversion using a user defined type
72 /// conversion function.
73 CK_UserDefinedConversion,
75 /// CK_ConstructorConversion - Conversion by constructor
76 CK_ConstructorConversion,
78 /// CK_IntegralToPointer - Integral to pointer
81 /// CK_PointerToIntegral - Pointer to integral
84 /// CK_ToVoid - Cast to void.
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.
92 /// CK_IntegralCast - Casting between integral types of different size.
95 /// CK_IntegralToFloating - Integral to floating point.
96 CK_IntegralToFloating,
98 /// CK_FloatingToIntegral - Floating point to integral.
99 CK_FloatingToIntegral,
101 /// CK_FloatingCast - Casting between floating types of different size.
104 /// CK_MemberPointerToBoolean - Member pointer to boolean
105 CK_MemberPointerToBoolean,
107 /// CK_AnyPointerToObjCPointerCast - Casting any pointer to objective-c
109 CK_AnyPointerToObjCPointerCast,
111 /// CK_AnyPointerToBlockPointerCast - Casting any pointer to block
113 CK_AnyPointerToBlockPointerCast,
115 /// \brief Converting between two Objective-C object types, which
116 /// can occur when performing reference binding to an Objective-C
118 CK_ObjCObjectLValueCast
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,
142 BO_Comma // [C99 6.5.17] Comma operator.
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.