@@ -604,7 +604,7 @@ Some additional meaningful categories of type:
604
604
605
605
- A *heap object reference * type is a type whose representation consists of a
606
606
single strong-reference-counted pointer. This includes all class types,
607
- the ``Builtin.ObjectPointer `` and ``Builtin.ObjCPointer `` types, and
607
+ the ``Builtin.NativeObject `` and ``Builtin.UnknownObject `` types, and
608
608
archetypes that conform to one or more class protocols.
609
609
- A *reference type * is more general in that its low-level representation may
610
610
include additional global pointers alongside a strong-reference-counted
@@ -2561,13 +2561,13 @@ dynamic_method
2561
2561
// or protocol type
2562
2562
//
2563
2563
// The "self" argument of the method type $@convention(thin) U -> V must be
2564
- // Builtin.ObjCPointer
2564
+ // Builtin.UnknownObject
2565
2565
2566
2566
Looks up the implementation of an Objective-C method with the same
2567
2567
selector as the named method for the dynamic type of the
2568
2568
value inside an existential container. The "self" operand of the result
2569
2569
function value is represented using an opaque type, the value for which must
2570
- be projected out as a value of type ``Builtin.ObjCPointer ``.
2570
+ be projected out as a value of type ``Builtin.UnknownObject ``.
2571
2571
2572
2572
It is undefined behavior if the dynamic type of the operand does not
2573
2573
have an implementation for the Objective-C method with the selector to
@@ -2740,7 +2740,7 @@ lowers to an uncurried entry point and is curried in the enclosing function::
2740
2740
// Create the bar closure
2741
2741
%bar_uncurried = function_ref @bar : $(Int, Int) -> Int
2742
2742
%bar = partial_apply %bar_uncurried(%x_box#0, %x_box#1) \
2743
- : $(Int, Builtin.ObjectPointer , *Int) -> Int
2743
+ : $(Int, Builtin.NativeObject , *Int) -> Int
2744
2744
2745
2745
// Apply it
2746
2746
%1 = integer_literal $Int, 1
@@ -2778,8 +2778,8 @@ metatype
2778
2778
2779
2779
sil-instruction ::= 'metatype' sil-type
2780
2780
2781
- %1 = metatype $T.metatype
2782
- // %1 has type $T.metatype
2781
+ %1 = metatype $T.Type
2782
+ // %1 has type $T.Type
2783
2783
2784
2784
Creates a reference to the metatype object for type ``T ``.
2785
2785
@@ -2789,9 +2789,9 @@ value_metatype
2789
2789
2790
2790
sil-instruction ::= 'value_metatype' sil-type ',' sil-operand
2791
2791
2792
- %1 = value_metatype $T.metatype , %0 : $T
2792
+ %1 = value_metatype $T.Type , %0 : $T
2793
2793
// %0 must be a value or address of type $T
2794
- // %1 will be of type $T.metatype
2794
+ // %1 will be of type $T.Type
2795
2795
2796
2796
Obtains a reference to the dynamic metatype of the value ``%0 ``.
2797
2797
@@ -2801,10 +2801,10 @@ existential_metatype
2801
2801
2802
2802
sil-instruction ::= 'existential_metatype' sil-type ',' sil-operand
2803
2803
2804
- %1 = existential_metatype $P.metatype , %0 : $P
2804
+ %1 = existential_metatype $P.Type , %0 : $P
2805
2805
// %0 must be a value of class protocol or protocol composition
2806
2806
// type $P, or an address of address-only protocol type $*P
2807
- // %1 will be a $P.metatype value referencing the metatype of the
2807
+ // %1 will be a $P.Type value referencing the metatype of the
2808
2808
// concrete value inside %0
2809
2809
2810
2810
Obtains the metatype of the concrete value
@@ -3004,16 +3004,16 @@ the enum is injected with an `inject_enum_addr`_ instruction::
3004
3004
sil @init_with_data : $(AddressOnlyType) -> AddressOnlyEnum {
3005
3005
entry(%0 : $*AddressOnlyEnum, %1 : $*AddressOnlyType):
3006
3006
// Store the data argument for the case.
3007
- %2 = init_enum_data_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.HasData
3007
+ %2 = init_enum_data_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.HasData!enumelt.1
3008
3008
copy_addr [take] %2 to [initialization] %1 : $*AddressOnlyType
3009
3009
// Inject the tag.
3010
- inject_enum_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.HasData
3010
+ inject_enum_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.HasData!enumelt.1
3011
3011
return
3012
3012
}
3013
3013
3014
3014
sil @init_without_data : $() -> AddressOnlyEnum {
3015
3015
// No data. We only need to inject the tag.
3016
- inject_enum_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.NoData
3016
+ inject_enum_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.NoData!enumelt
3017
3017
return
3018
3018
}
3019
3019
@@ -3024,7 +3024,7 @@ discriminator and is done with the `switch_enum`_ terminator::
3024
3024
3025
3025
sil @switch_foo : $(Foo) -> () {
3026
3026
entry(%foo : $Foo):
3027
- switch_enum %foo : $Foo, case #Foo.A: a_dest, case #Foo.B: b_dest
3027
+ switch_enum %foo : $Foo, case #Foo.A!enumelt.1 : a_dest, case #Foo.B!enumelt.1 : b_dest
3028
3028
3029
3029
a_dest(%a : $Int):
3030
3030
/* use %a */
@@ -3041,14 +3041,15 @@ projecting the enum value with `unchecked_take_enum_data_addr`_::
3041
3041
3042
3042
sil @switch_foo : $<T> (Foo<T>) -> () {
3043
3043
entry(%foo : $*Foo<T>):
3044
- switch_enum_addr %foo : $*Foo<T>, case #Foo.A: a_dest, case #Foo.B: b_dest
3044
+ switch_enum_addr %foo : $*Foo<T>, case #Foo.A!enumelt.1: a_dest, \
3045
+ case #Foo.B!enumelt.1: b_dest
3045
3046
3046
3047
a_dest:
3047
- %a = unchecked_take_enum_data_addr %foo : $*Foo<T>, #Foo.A
3048
+ %a = unchecked_take_enum_data_addr %foo : $*Foo<T>, #Foo.A!enumelt.1
3048
3049
/* use %a */
3049
3050
3050
3051
b_dest:
3051
- %b = unchecked_take_enum_data_addr %foo : $*Foo<T>, #Foo.B
3052
+ %b = unchecked_take_enum_data_addr %foo : $*Foo<T>, #Foo.B!enumelt.1
3052
3053
/* use %b */
3053
3054
}
3054
3055
@@ -3058,8 +3059,8 @@ enum
3058
3059
3059
3060
sil-instruction ::= 'enum' sil-type ',' sil-decl-ref (',' sil-operand)?
3060
3061
3061
- %1 = enum $U, #U.EmptyCase
3062
- %1 = enum $U, #U.DataCase, %0 : $T
3062
+ %1 = enum $U, #U.EmptyCase!enumelt
3063
+ %1 = enum $U, #U.DataCase!enumelt.1 , %0 : $T
3063
3064
// $U must be an enum type
3064
3065
// #U.DataCase or #U.EmptyCase must be a case of enum $U
3065
3066
// If #U.Case has a data type $T, %0 must be a value of type $T
@@ -3075,7 +3076,7 @@ unchecked_enum_data
3075
3076
3076
3077
sil-instruction ::= 'unchecked_enum_data' sil-operand ',' sil-decl-ref
3077
3078
3078
- %1 = unchecked_enum_data %0 : $U, #U.DataCase
3079
+ %1 = unchecked_enum_data %0 : $U, #U.DataCase!enumelt.1
3079
3080
// $U must be an enum type
3080
3081
// #U.DataCase must be a case of enum $U with data
3081
3082
// %1 will be of object type $T for the data type of case U.DataCase
@@ -3090,7 +3091,7 @@ init_enum_data_addr
3090
3091
3091
3092
sil-instruction ::= 'init_enum_data_addr' sil-operand ',' sil-decl-ref
3092
3093
3093
- %1 = init_enum_data_addr %0 : $*U, #U.DataCase
3094
+ %1 = init_enum_data_addr %0 : $*U, #U.DataCase!enumelt.1
3094
3095
// $U must be an enum type
3095
3096
// #U.DataCase must be a case of enum $U with data
3096
3097
// %1 will be of address type $*T for the data type of case U.DataCase
@@ -3112,7 +3113,7 @@ inject_enum_addr
3112
3113
3113
3114
sil-instruction ::= 'inject_enum_addr' sil-operand ',' sil-decl-ref
3114
3115
3115
- inject_enum_addr %0 : $*U, #U.Case
3116
+ inject_enum_addr %0 : $*U, #U.Case!enumelt
3116
3117
// $U must be an enum type
3117
3118
// #U.Case must be a case of enum $U
3118
3119
// %0 will be overlaid with the tag for #U.Case
@@ -3132,7 +3133,7 @@ unchecked_take_enum_data_addr
3132
3133
3133
3134
sil-instruction ::= 'unchecked_take_enum_data_addr' sil-operand ',' sil-decl-ref
3134
3135
3135
- %1 = unchecked_take_enum_data_addr %0 : $*U, #U.DataCase
3136
+ %1 = unchecked_take_enum_data_addr %0 : $*U, #U.DataCase!enumelt.1
3136
3137
// $U must be an enum type
3137
3138
// #U.DataCase must be a case of enum $U with data
3138
3139
// %1 will be of address type $*T for the data type of case U.DataCase
@@ -3159,8 +3160,8 @@ select_enum
3159
3160
':' sil-type
3160
3161
3161
3162
%n = select_enum %0 : $U, \
3162
- case #U.Case1: %1, \
3163
- case #U.Case2: %2, /* ... */ \
3163
+ case #U.Case1!enumelt : %1, \
3164
+ case #U.Case2!enumelt : %2, /* ... */ \
3164
3165
default %3 : $T
3165
3166
3166
3167
// $U must be an enum type
@@ -3173,8 +3174,8 @@ enum value. This is equivalent to a trivial `switch_enum`_ branch sequence::
3173
3174
3174
3175
entry:
3175
3176
switch_enum %0 : $U, \
3176
- case #U.Case1: bb1, \
3177
- case #U.Case2: bb2, /* ... */ \
3177
+ case #U.Case1!enumelt : bb1, \
3178
+ case #U.Case2!enumelt : bb2, /* ... */ \
3178
3179
default bb_default
3179
3180
bb1:
3180
3181
br cont(%1 : $T) // value for #U.Case1
@@ -3198,8 +3199,8 @@ select_enum_addr
3198
3199
':' sil-type
3199
3200
3200
3201
%n = select_enum_addr %0 : $*U, \
3201
- case #U.Case1: %1, \
3202
- case #U.Case2: %2, /* ... */ \
3202
+ case #U.Case1!enumelt : %1, \
3203
+ case #U.Case2!enumelt : %2, /* ... */ \
3203
3204
default %3 : $T
3204
3205
3205
3206
// %0 must be the address of an enum type $*U
@@ -3629,7 +3630,7 @@ ref_to_raw_pointer
3629
3630
sil-instruction ::= 'ref_to_raw_pointer' sil-operand 'to' sil-type
3630
3631
3631
3632
%1 = ref_to_raw_pointer %0 : $C to $Builtin.RawPointer
3632
- // $C must be a class type, or Builtin.ObjectPointer , or Builtin.ObjCPointer
3633
+ // $C must be a class type, or Builtin.NativeObject , or Builtin.UnknownObject
3633
3634
// %1 will be of type $Builtin.RawPointer
3634
3635
3635
3636
Converts a heap object reference to a ``Builtin.RawPointer ``. The ``RawPointer ``
@@ -3644,7 +3645,7 @@ raw_pointer_to_ref
3644
3645
sil-instruction ::= 'raw_pointer_to_ref' sil-operand 'to' sil-type
3645
3646
3646
3647
%1 = raw_pointer_to_ref %0 : $Builtin.RawPointer to $C
3647
- // $C must be a class type, or Builtin.ObjectPointer , or Builtin.ObjCPointer
3648
+ // $C must be a class type, or Builtin.NativeObject , or Builtin.UnknownObject
3648
3649
// %1 will be of type $C
3649
3650
3650
3651
Converts a ``Builtin.RawPointer `` back to a heap object reference. Casting
@@ -3811,10 +3812,10 @@ thick_to_objc_metatype
3811
3812
3812
3813
sil-instruction ::= 'thick_to_objc_metatype' sil-operand 'to' sil-type
3813
3814
3814
- %1 = thick_to_objc_metatype %0 : $@thick T.metatype to $@objc_metatype T.metatype
3815
- // %0 must be of a thick metatype type $@thick T.metatype
3815
+ %1 = thick_to_objc_metatype %0 : $@thick T.Type to $@objc_metatype T.Type
3816
+ // %0 must be of a thick metatype type $@thick T.Type
3816
3817
// The destination type must be the corresponding Objective-C metatype type
3817
- // %1 will be of type $@objc_metatype T.metatype
3818
+ // %1 will be of type $@objc_metatype T.Type
3818
3819
3819
3820
Converts a thick metatype to an Objective-C class metatype. ``T `` must
3820
3821
be of class, class protocol, or class protocol composition type.
@@ -3825,10 +3826,10 @@ objc_to_thick_metatype
3825
3826
3826
3827
sil-instruction ::= 'objc_to_thick_metatype' sil-operand 'to' sil-type
3827
3828
3828
- %1 = objc_to_thick_metatype %0 : $@objc_metatype T.metatype to $@thick T.metatype
3829
- // %0 must be of an Objective-C metatype type $@objc_metatype T.metatype
3829
+ %1 = objc_to_thick_metatype %0 : $@objc_metatype T.Type to $@thick T.Type
3830
+ // %0 must be of an Objective-C metatype type $@objc_metatype T.Type
3830
3831
// The destination type must be the corresponding thick metatype type
3831
- // %1 will be of type $@thick T.metatype
3832
+ // %1 will be of type $@thick T.Type
3832
3833
3833
3834
Converts an Objective-C class metatype to a thick metatype. ``T `` must
3834
3835
be of class, class protocol, or class protocol composition type.
@@ -4089,8 +4090,8 @@ switch_enum
4089
4090
(',' sil-switch-default)?
4090
4091
sil-switch-enum-case ::= 'case' sil-decl-ref ':' sil-identifier
4091
4092
4092
- switch_enum %0 : $U, case #U.Foo: label1, \
4093
- case #U.Bar: label2, \
4093
+ switch_enum %0 : $U, case #U.Foo!enumelt : label1, \
4094
+ case #U.Bar!enumelt : label2, \
4094
4095
..., \
4095
4096
default labelN
4096
4097
@@ -4124,9 +4125,9 @@ original enum value. For example::
4124
4125
sil @sum_of_foo : $Foo -> Int {
4125
4126
entry(%x : $Foo):
4126
4127
switch_enum %x : $Foo, \
4127
- case #Foo.Nothing: nothing, \
4128
- case #Foo.OneInt: one_int, \
4129
- case #Foo.TwoInts: two_ints
4128
+ case #Foo.Nothing!enumelt : nothing, \
4129
+ case #Foo.OneInt!enumelt.1 : one_int, \
4130
+ case #Foo.TwoInts!enumelt.1 : two_ints
4130
4131
4131
4132
nothing:
4132
4133
%zero = integer_literal 0 : $Int
@@ -4165,8 +4166,8 @@ switch_enum_addr
4165
4166
(',' sil-switch-enum-case)*
4166
4167
(',' sil-switch-default)?
4167
4168
4168
- switch_enum_addr %0 : $*U, case #U.Foo: label1, \
4169
- case #U.Bar: label2, \
4169
+ switch_enum_addr %0 : $*U, case #U.Foo!enumelt : label1, \
4170
+ case #U.Bar!enumelt : label2, \
4170
4171
..., \
4171
4172
default labelN
4172
4173
0 commit comments