Skip to content

Commit c5c4aa0

Browse files
authored
Merge pull request #24789 from nkcsgexi/digester-fix-5.1
[5.1] cherry-pick recent api-digester fixes.
2 parents b711d8a + 1a917ad commit c5c4aa0

File tree

12 files changed

+224
-102
lines changed

12 files changed

+224
-102
lines changed

include/swift/AST/DiagnosticsModuleDiffer.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ ERROR(conformance_removed,none,"%0 has removed %select{conformance to|inherited
6868

6969
ERROR(conformance_added,none,"%0 has added inherited protocol %1", (StringRef, StringRef))
7070

71+
ERROR(existing_conformance_added,none,"%0 has added a conformance to an existing protocol %1", (StringRef, StringRef))
72+
7173
ERROR(default_associated_type_removed,none,"%0 has removed default type %1", (StringRef, StringRef))
7274

7375
ERROR(protocol_req_added,none,"%0 has been added as a protocol requirement", (StringRef))

test/api-digester/Outputs/Cake-abi.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ cake1: Func ObjCProtocol.addOptional() is now an optional requirement
7373
cake1: Func ObjCProtocol.removeOptional() is no longer an optional requirement
7474
cake1: Protocol P3 has removed inherited protocol P2
7575
cake1: Struct fixedLayoutStruct has removed conformance to P1
76+
cake2: Class C7 has added a conformance to an existing protocol P1
77+
cake2: Class SuperClassChange has added a conformance to an existing protocol P1
7678
cake2: Protocol P3 has added inherited protocol P4
79+
cake2: Struct fixedLayoutStruct has added a conformance to an existing protocol P2
7780

7881
/* Protocol Requirement Change */
7982
cake1: Accessor HasMutatingMethodClone.bar.Get() now requires new witness table entry

test/api-digester/Outputs/cake-abi.json

Lines changed: 65 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@
6464
{
6565
"kind": "Conformance",
6666
"name": "P2",
67-
"printedName": "P2"
67+
"printedName": "P2",
68+
"usr": "s:4cake2P2P"
6869
},
6970
{
7071
"kind": "Conformance",
7172
"name": "P1",
72-
"printedName": "P1"
73+
"printedName": "P1",
74+
"usr": "s:4cake2P1P"
7375
}
7476
]
7577
},
@@ -138,12 +140,14 @@
138140
{
139141
"kind": "Conformance",
140142
"name": "P1",
141-
"printedName": "P1"
143+
"printedName": "P1",
144+
"usr": "s:4cake2P1P"
142145
},
143146
{
144147
"kind": "Conformance",
145148
"name": "P2",
146-
"printedName": "P2"
149+
"printedName": "P2",
150+
"usr": "s:4cake2P2P"
147151
}
148152
]
149153
},
@@ -555,12 +559,14 @@
555559
{
556560
"kind": "Conformance",
557561
"name": "Equatable",
558-
"printedName": "Equatable"
562+
"printedName": "Equatable",
563+
"usr": "s:SQ"
559564
},
560565
{
561566
"kind": "Conformance",
562567
"name": "Hashable",
563-
"printedName": "Hashable"
568+
"printedName": "Hashable",
569+
"usr": "s:SH"
564570
},
565571
{
566572
"kind": "Conformance",
@@ -580,7 +586,8 @@
580586
}
581587
]
582588
}
583-
]
589+
],
590+
"usr": "s:SY"
584591
}
585592
]
586593
},
@@ -1081,7 +1088,8 @@
10811088
{
10821089
"kind": "Conformance",
10831090
"name": "PSuper",
1084-
"printedName": "PSuper"
1091+
"printedName": "PSuper",
1092+
"usr": "s:4cake6PSuperP"
10851093
}
10861094
]
10871095
},
@@ -1231,12 +1239,14 @@
12311239
"kind": "Conformance",
12321240
"name": "P1",
12331241
"printedName": "P1",
1242+
"usr": "s:4cake2P1P",
12341243
"isABIPlaceholder": true
12351244
},
12361245
{
12371246
"kind": "Conformance",
12381247
"name": "P2",
1239-
"printedName": "P2"
1248+
"printedName": "P2",
1249+
"usr": "s:4cake2P2P"
12401250
}
12411251
]
12421252
},
@@ -1288,17 +1298,20 @@
12881298
{
12891299
"kind": "Conformance",
12901300
"name": "FixedWidthInteger",
1291-
"printedName": "FixedWidthInteger"
1301+
"printedName": "FixedWidthInteger",
1302+
"usr": "s:s17FixedWidthIntegerP"
12921303
},
12931304
{
12941305
"kind": "Conformance",
12951306
"name": "SignedInteger",
1296-
"printedName": "SignedInteger"
1307+
"printedName": "SignedInteger",
1308+
"usr": "s:SZ"
12971309
},
12981310
{
12991311
"kind": "Conformance",
13001312
"name": "_ExpressibleByBuiltinIntegerLiteral",
1301-
"printedName": "_ExpressibleByBuiltinIntegerLiteral"
1313+
"printedName": "_ExpressibleByBuiltinIntegerLiteral",
1314+
"usr": "s:s35_ExpressibleByBuiltinIntegerLiteralP"
13021315
},
13031316
{
13041317
"kind": "Conformance",
@@ -1318,17 +1331,20 @@
13181331
}
13191332
]
13201333
}
1321-
]
1334+
],
1335+
"usr": "s:Sz"
13221336
},
13231337
{
13241338
"kind": "Conformance",
13251339
"name": "LosslessStringConvertible",
1326-
"printedName": "LosslessStringConvertible"
1340+
"printedName": "LosslessStringConvertible",
1341+
"usr": "s:s25LosslessStringConvertibleP"
13271342
},
13281343
{
13291344
"kind": "Conformance",
13301345
"name": "SignedNumeric",
1331-
"printedName": "SignedNumeric"
1346+
"printedName": "SignedNumeric",
1347+
"usr": "s:s13SignedNumericP"
13321348
},
13331349
{
13341350
"kind": "Conformance",
@@ -1348,12 +1364,14 @@
13481364
}
13491365
]
13501366
}
1351-
]
1367+
],
1368+
"usr": "s:Sj"
13521369
},
13531370
{
13541371
"kind": "Conformance",
13551372
"name": "CustomStringConvertible",
1356-
"printedName": "CustomStringConvertible"
1373+
"printedName": "CustomStringConvertible",
1374+
"usr": "s:s23CustomStringConvertibleP"
13571375
},
13581376
{
13591377
"kind": "Conformance",
@@ -1373,12 +1391,14 @@
13731391
}
13741392
]
13751393
}
1376-
]
1394+
],
1395+
"usr": "s:Sx"
13771396
},
13781397
{
13791398
"kind": "Conformance",
13801399
"name": "AdditiveArithmetic",
1381-
"printedName": "AdditiveArithmetic"
1400+
"printedName": "AdditiveArithmetic",
1401+
"usr": "s:s18AdditiveArithmeticP"
13821402
},
13831403
{
13841404
"kind": "Conformance",
@@ -1398,57 +1418,68 @@
13981418
}
13991419
]
14001420
}
1401-
]
1421+
],
1422+
"usr": "s:s27ExpressibleByIntegerLiteralP"
14021423
},
14031424
{
14041425
"kind": "Conformance",
14051426
"name": "Comparable",
1406-
"printedName": "Comparable"
1427+
"printedName": "Comparable",
1428+
"usr": "s:SL"
14071429
},
14081430
{
14091431
"kind": "Conformance",
14101432
"name": "P1",
1411-
"printedName": "P1"
1433+
"printedName": "P1",
1434+
"usr": "s:4cake2P1P"
14121435
},
14131436
{
14141437
"kind": "Conformance",
14151438
"name": "Encodable",
1416-
"printedName": "Encodable"
1439+
"printedName": "Encodable",
1440+
"usr": "s:SE"
14171441
},
14181442
{
14191443
"kind": "Conformance",
14201444
"name": "Decodable",
1421-
"printedName": "Decodable"
1445+
"printedName": "Decodable",
1446+
"usr": "s:Se"
14221447
},
14231448
{
14241449
"kind": "Conformance",
14251450
"name": "Hashable",
1426-
"printedName": "Hashable"
1451+
"printedName": "Hashable",
1452+
"usr": "s:SH"
14271453
},
14281454
{
14291455
"kind": "Conformance",
14301456
"name": "Equatable",
1431-
"printedName": "Equatable"
1457+
"printedName": "Equatable",
1458+
"usr": "s:SQ"
14321459
},
14331460
{
14341461
"kind": "Conformance",
14351462
"name": "_HasCustomAnyHashableRepresentation",
1436-
"printedName": "_HasCustomAnyHashableRepresentation"
1463+
"printedName": "_HasCustomAnyHashableRepresentation",
1464+
"usr": "s:s35_HasCustomAnyHashableRepresentationP"
14371465
},
14381466
{
14391467
"kind": "Conformance",
14401468
"name": "CustomReflectable",
1441-
"printedName": "CustomReflectable"
1469+
"printedName": "CustomReflectable",
1470+
"usr": "s:s17CustomReflectableP"
14421471
},
14431472
{
14441473
"kind": "Conformance",
14451474
"name": "_CustomPlaygroundQuickLookable",
1446-
"printedName": "_CustomPlaygroundQuickLookable"
1475+
"printedName": "_CustomPlaygroundQuickLookable",
1476+
"usr": "s:s30_CustomPlaygroundQuickLookableP"
14471477
},
14481478
{
14491479
"kind": "Conformance",
14501480
"name": "MirrorPath",
1451-
"printedName": "MirrorPath"
1481+
"printedName": "MirrorPath",
1482+
"usr": "s:s10MirrorPathP"
14521483
},
14531484
{
14541485
"kind": "Conformance",
@@ -1546,12 +1577,14 @@
15461577
}
15471578
]
15481579
}
1549-
]
1580+
],
1581+
"usr": "s:s10SIMDScalarP"
15501582
},
15511583
{
15521584
"kind": "Conformance",
15531585
"name": "CVarArg",
1554-
"printedName": "CVarArg"
1586+
"printedName": "CVarArg",
1587+
"usr": "s:s7CVarArgP"
15551588
}
15561589
]
15571590
}

0 commit comments

Comments
 (0)