Skip to content

Commit 9862778

Browse files
committed
swift-api-digester: print raw type names for raw representable API changes.
1 parent 51d407a commit 9862778

File tree

4 files changed

+137
-48
lines changed

4 files changed

+137
-48
lines changed

include/swift/IDE/DigesterEnums.def

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ NODE_ANNOTATION(NowThrowing)
6363
NODE_ANNOTATION(NowMutating)
6464
NODE_ANNOTATION(StaticChange)
6565
NODE_ANNOTATION(OwnershipChange)
66+
NODE_ANNOTATION(RawTypeLeft)
67+
NODE_ANNOTATION(RawTypeRight)
6668

6769
NODE_ANNOTATION_CHANGE_KIND(ImplicitOptionalToOptional)
6870
NODE_ANNOTATION_CHANGE_KIND(OptionalToImplicitOptional)
@@ -71,23 +73,27 @@ NODE_ANNOTATION_CHANGE_KIND(WrapImplicitOptional)
7173
NODE_ANNOTATION_CHANGE_KIND(UnwrapOptional)
7274
NODE_ANNOTATION_CHANGE_KIND(GetterToProperty)
7375
NODE_ANNOTATION_CHANGE_KIND(SetterToProperty)
74-
NODE_ANNOTATION_CHANGE_KIND(TypeRewritten)
75-
NODE_ANNOTATION_CHANGE_KIND(ModernizeEnum)
76-
NODE_ANNOTATION_CHANGE_KIND(UnwrapUnmanaged)
77-
NODE_ANNOTATION_CHANGE_KIND(Rename)
7876
NODE_ANNOTATION_CHANGE_KIND(DictionaryKeyUpdate)
7977
NODE_ANNOTATION_CHANGE_KIND(OptionalDictionaryKeyUpdate)
8078
NODE_ANNOTATION_CHANGE_KIND(ArrayMemberUpdate)
8179
NODE_ANNOTATION_CHANGE_KIND(OptionalArrayMemberUpdate)
8280
NODE_ANNOTATION_CHANGE_KIND(SimpleStringRepresentableUpdate)
8381
NODE_ANNOTATION_CHANGE_KIND(SimpleOptionalStringRepresentableUpdate)
82+
8483
NODE_ANNOTATION_CHANGE_KIND(RevertDictionaryKeyUpdate)
8584
NODE_ANNOTATION_CHANGE_KIND(RevertOptionalDictionaryKeyUpdate)
8685
NODE_ANNOTATION_CHANGE_KIND(RevertArrayMemberUpdate)
8786
NODE_ANNOTATION_CHANGE_KIND(RevertOptionalArrayMemberUpdate)
8887
NODE_ANNOTATION_CHANGE_KIND(RevertSimpleStringRepresentableUpdate)
8988
NODE_ANNOTATION_CHANGE_KIND(RevertSimpleOptionalStringRepresentableUpdate)
9089

90+
NODE_ANNOTATION_CHANGE_KIND(ModernizeEnum)
91+
NODE_ANNOTATION_CHANGE_KIND(UnwrapUnmanaged)
92+
NODE_ANNOTATION_CHANGE_KIND(Rename)
93+
94+
// Keep type rewritten the last one.
95+
NODE_ANNOTATION_CHANGE_KIND(TypeRewritten)
96+
9197
DECL_ATTR(deprecated)
9298
DECL_ATTR(fixedLayout)
9399

@@ -120,6 +126,7 @@ KNOWN_TYPE(Function)
120126
KNOWN_TYPE(Dictionary)
121127
KNOWN_TYPE(String)
122128
KNOWN_TYPE(Array)
129+
KNOWN_TYPE(Int)
123130

124131
KNOWN_PROTOCOL(RawRepresentable)
125132

test/api-digester/Outputs/apinotes-migrator-gen-revert.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,17 @@
197197
"RightComment": "",
198198
"ModuleName": "APINotesTest"
199199
},
200+
{
201+
"DiffItemKind": "CommonDiffItem",
202+
"NodeKind": "Function",
203+
"NodeAnnotation": "RevertSimpleStringRepresentableUpdate",
204+
"ChildIndex": "1",
205+
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(cm)animalStatusSingleAttribute:",
206+
"LeftComment": "",
207+
"RightUsr": "",
208+
"RightComment": "",
209+
"ModuleName": "APINotesTest"
210+
},
200211
{
201212
"DiffItemKind": "CommonDiffItem",
202213
"NodeKind": "Function",

test/api-digester/Outputs/apinotes-migrator-gen.json

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"NodeAnnotation": "DictionaryKeyUpdate",
1717
"ChildIndex": "1",
1818
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingAttributes:",
19-
"LeftComment": "",
19+
"LeftComment": "String",
2020
"RightUsr": "",
2121
"RightComment": "AnimalAttributeName",
2222
"ModuleName": "APINotesTest"
@@ -38,7 +38,7 @@
3838
"NodeAnnotation": "DictionaryKeyUpdate",
3939
"ChildIndex": "1",
4040
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingAttributes:",
41-
"LeftComment": "",
41+
"LeftComment": "String",
4242
"RightUsr": "",
4343
"RightComment": "AnimalAttributeName",
4444
"ModuleName": "APINotesTest"
@@ -60,7 +60,7 @@
6060
"NodeAnnotation": "OptionalDictionaryKeyUpdate",
6161
"ChildIndex": "1",
6262
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingOptionalAttributes:",
63-
"LeftComment": "",
63+
"LeftComment": "String",
6464
"RightUsr": "",
6565
"RightComment": "AnimalAttributeName",
6666
"ModuleName": "APINotesTest"
@@ -82,7 +82,7 @@
8282
"NodeAnnotation": "OptionalDictionaryKeyUpdate",
8383
"ChildIndex": "1",
8484
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingOptionalAttributes:",
85-
"LeftComment": "",
85+
"LeftComment": "String",
8686
"RightUsr": "",
8787
"RightComment": "AnimalAttributeName",
8888
"ModuleName": "APINotesTest"
@@ -104,7 +104,7 @@
104104
"NodeAnnotation": "ArrayMemberUpdate",
105105
"ChildIndex": "1",
106106
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingAttributesArray:",
107-
"LeftComment": "",
107+
"LeftComment": "String",
108108
"RightUsr": "",
109109
"RightComment": "AnimalAttributeName",
110110
"ModuleName": "APINotesTest"
@@ -126,7 +126,7 @@
126126
"NodeAnnotation": "ArrayMemberUpdate",
127127
"ChildIndex": "1",
128128
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingAttributesArray:",
129-
"LeftComment": "",
129+
"LeftComment": "String",
130130
"RightUsr": "",
131131
"RightComment": "AnimalAttributeName",
132132
"ModuleName": "APINotesTest"
@@ -148,7 +148,7 @@
148148
"NodeAnnotation": "OptionalArrayMemberUpdate",
149149
"ChildIndex": "1",
150150
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingOptionalAttributesArray:",
151-
"LeftComment": "",
151+
"LeftComment": "String",
152152
"RightUsr": "",
153153
"RightComment": "AnimalAttributeName",
154154
"ModuleName": "APINotesTest"
@@ -170,7 +170,7 @@
170170
"NodeAnnotation": "OptionalArrayMemberUpdate",
171171
"ChildIndex": "1",
172172
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(im)animalStatusDescriptorByAddingOptionalAttributesArray:",
173-
"LeftComment": "",
173+
"LeftComment": "String",
174174
"RightUsr": "",
175175
"RightComment": "AnimalAttributeName",
176176
"ModuleName": "APINotesTest"
@@ -192,7 +192,7 @@
192192
"NodeAnnotation": "SimpleOptionalStringRepresentableUpdate",
193193
"ChildIndex": "1",
194194
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(cm)animalStatusSingleOptionalAttribute:",
195-
"LeftComment": "",
195+
"LeftComment": "String",
196196
"RightUsr": "",
197197
"RightComment": "AnimalAttributeName",
198198
"ModuleName": "APINotesTest"
@@ -203,7 +203,18 @@
203203
"NodeAnnotation": "SimpleStringRepresentableUpdate",
204204
"ChildIndex": "1",
205205
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(cm)animalStatusSingleAttribute:",
206-
"LeftComment": "",
206+
"LeftComment": "String",
207+
"RightUsr": "",
208+
"RightComment": "AnimalAttributeName",
209+
"ModuleName": "APINotesTest"
210+
},
211+
{
212+
"DiffItemKind": "CommonDiffItem",
213+
"NodeKind": "Function",
214+
"NodeAnnotation": "TypeRewritten",
215+
"ChildIndex": "1",
216+
"LeftUsr": "c:objc(cs)AnimalStatusDescriptor(cm)animalStatusSingleAttribute:",
217+
"LeftComment": "String",
207218
"RightUsr": "",
208219
"RightComment": "AnimalAttributeName",
209220
"ModuleName": "APINotesTest"
@@ -236,7 +247,7 @@
236247
"NodeAnnotation": "SimpleStringRepresentableUpdate",
237248
"ChildIndex": "0",
238249
"LeftUsr": "c:@globalAttributeName",
239-
"LeftComment": "",
250+
"LeftComment": "String",
240251
"RightUsr": "",
241252
"RightComment": "AnimalAttributeName",
242253
"ModuleName": "APINotesTest"

0 commit comments

Comments
 (0)