diff options
Diffstat (limited to 'include/clang/AST/OperationKinds.h')
-rw-r--r-- | include/clang/AST/OperationKinds.h | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/include/clang/AST/OperationKinds.h b/include/clang/AST/OperationKinds.h index 92ff6041371cf..469da99a8cbf6 100644 --- a/include/clang/AST/OperationKinds.h +++ b/include/clang/AST/OperationKinds.h @@ -31,9 +31,12 @@ enum CastKind { /// to be reinterpreted as a bit pattern of another type. Generally /// the operands must have equivalent size and unrelated types. /// - /// The pointer conversion char* -> int* is a bitcast. Many other - /// pointer conversions which are "physically" bitcasts are given - /// special cast kinds. + /// The pointer conversion char* -> int* is a bitcast. A conversion + /// from any pointer type to a C pointer type is a bitcast unless + /// it's actually BaseToDerived or DerivedToBase. A conversion to a + /// block pointer or ObjC pointer type is a bitcast only if the + /// operand has the same type kind; otherwise, it's one of the + /// specialized casts below. /// /// Vector coercions are bitcasts. CK_BitCast, @@ -186,12 +189,16 @@ enum CastKind { /// (float) ld CK_FloatingCast, - /// CK_AnyPointerToObjCPointerCast - Casting any other pointer kind - /// to an Objective-C pointer. - CK_AnyPointerToObjCPointerCast, + /// CK_CPointerToObjCPointerCast - Casting a C pointer kind to an + /// Objective-C pointer. + CK_CPointerToObjCPointerCast, - /// CK_AnyPointerToBlockPointerCast - Casting any other pointer kind - /// to a block pointer. + /// CK_BlockPointerToObjCPointerCast - Casting a block pointer to an + /// ObjC pointer. + CK_BlockPointerToObjCPointerCast, + + /// CK_AnyPointerToBlockPointerCast - Casting any non-block pointer + /// to a block pointer. Block-to-block casts are bitcasts. CK_AnyPointerToBlockPointerCast, /// \brief Converting between two Objective-C object types, which @@ -247,20 +254,27 @@ enum CastKind { /// _Complex unsigned -> _Complex float CK_IntegralComplexToFloatingComplex, - /// \brief Produces a retainable object pointer so that it may be - /// consumed, e.g. by being passed to a consuming parameter. Calls - /// objc_retain. - CK_ObjCProduceObject, + /// \brief [ARC] Produces a retainable object pointer so that it may + /// be consumed, e.g. by being passed to a consuming parameter. + /// Calls objc_retain. + CK_ARCProduceObject, - /// \brief Consumes a retainable object pointer that has just been - /// produced, e.g. as the return value of a retaining call. Enters - /// a cleanup to call objc_release at some indefinite time. - CK_ObjCConsumeObject, + /// \brief [ARC] Consumes a retainable object pointer that has just + /// been produced, e.g. as the return value of a retaining call. + /// Enters a cleanup to call objc_release at some indefinite time. + CK_ARCConsumeObject, - /// \brief Reclaim a retainable object pointer object that may have - /// been produced and autoreleased as part of a function return + /// \brief [ARC] Reclaim a retainable object pointer object that may + /// have been produced and autoreleased as part of a function return /// sequence. - CK_ObjCReclaimReturnedObject + CK_ARCReclaimReturnedObject, + + /// \brief [ARC] Causes a value of block type to be copied to the + /// heap, if it is not already there. A number of other operations + /// in ARC cause blocks to be copied; this is for cases where that + /// would not otherwise be guaranteed, such as when casting to a + /// non-block pointer type. + CK_ARCExtendBlockObject }; #define CK_Invalid ((CastKind) -1) |