22
22
#include " swift/Basic/LLVM.h"
23
23
24
24
#include " swift/ABI/MetadataValues.h"
25
- #include " swift/AST/InvertibleProtocolKind.h"
26
25
#include " swift/AST/LayoutConstraintKind.h"
27
26
#include " swift/AST/RequirementKind.h"
28
27
#include " swift/Basic/OptionSet.h"
@@ -423,13 +422,10 @@ getObjCClassOrProtocolName(NodePointer node) {
423
422
#endif
424
423
425
424
template <typename BuiltType, typename BuiltRequirement,
426
- typename BuiltInverseRequirement,
427
425
typename BuiltLayoutConstraint, typename BuilderType>
428
- void decodeRequirement (
429
- NodePointer node,
430
- llvm::SmallVectorImpl<BuiltRequirement> &requirements,
431
- llvm::SmallVectorImpl<BuiltInverseRequirement> &inverseRequirements,
432
- BuilderType &Builder) {
426
+ void decodeRequirement (NodePointer node,
427
+ llvm::SmallVectorImpl<BuiltRequirement> &requirements,
428
+ BuilderType &Builder) {
433
429
for (auto &child : *node) {
434
430
if (child->getKind () == Demangle::Node::Kind::DependentGenericParamCount ||
435
431
child->getKind () == Demangle::Node::Kind::DependentGenericParamPackMarker)
@@ -455,40 +451,9 @@ void decodeRequirement(
455
451
return ;
456
452
} else if (child->getKind () ==
457
453
Demangle::Node::Kind::DependentGenericInverseConformanceRequirement) {
458
- // Type child
459
- auto constraintNode = child->getChild (1 );
460
- if (constraintNode->getKind () != Demangle::Node::Kind::Type ||
461
- constraintNode->getNumChildren () != 1 )
462
- return ;
463
-
464
- // Protocol child
465
- auto protocolNode = constraintNode->getChild (0 );
466
- if (protocolNode->getKind () != Demangle::Node::Kind::Protocol ||
467
- protocolNode->getNumChildren () != 2 )
468
- return ;
469
-
470
- auto moduleNode = protocolNode->getChild (0 );
471
- if (moduleNode->getKind () != Demangle::Node::Kind::Module ||
472
- moduleNode->getText () != " Swift" )
473
- return ;
474
-
475
- auto protocolNameNode = protocolNode->getChild (1 );
476
- if (protocolNameNode->getKind () != Demangle::Node::Kind::Identifier)
477
- return ;
478
-
479
- auto protocolName = protocolNameNode->getText ();
480
- using OptInvertibleKind = std::optional<InvertibleProtocolKind>;
481
- auto protocolKind = llvm::StringSwitch<OptInvertibleKind>(protocolName)
482
- #define INVERTIBLE_PROTOCOL_WITH_NAME (Id, Name ) \
483
- .Case (Name, InvertibleProtocolKind::Id)
484
- #include " swift/AST/KnownProtocols.def"
485
- .Default (std::nullopt);
486
- if (!protocolKind)
487
- return ;
488
-
489
- inverseRequirements.push_back (
490
- Builder.createInverseRequirement (subjectType, *protocolKind));
491
- continue ;
454
+ // FIXME(kavon): this is unimplemented! We should build a PCT here with
455
+ // the inverse in it.
456
+ return ;
492
457
}
493
458
494
459
@@ -573,7 +538,6 @@ class TypeDecoder {
573
538
using Field = typename BuilderType::BuiltSILBoxField;
574
539
using BuiltSubstitution = typename BuilderType::BuiltSubstitution;
575
540
using BuiltRequirement = typename BuilderType::BuiltRequirement;
576
- using BuiltInverseRequirement = typename BuilderType::BuiltInverseRequirement;
577
541
using BuiltLayoutConstraint = typename BuilderType::BuiltLayoutConstraint;
578
542
using BuiltGenericSignature = typename BuilderType::BuiltGenericSignature;
579
543
using BuiltSubstitutionMap = typename BuilderType::BuiltSubstitutionMap;
@@ -836,19 +800,16 @@ class TypeDecoder {
836
800
return protocolType;
837
801
838
802
llvm::SmallVector<BuiltRequirement, 8 > requirements;
839
- llvm::SmallVector<BuiltInverseRequirement, 8 > inverseRequirements;
840
803
841
804
auto *reqts = Node->getChild (1 );
842
805
if (reqts->getKind () != NodeKind::ConstrainedExistentialRequirementList)
843
806
return MAKE_NODE_TYPE_ERROR0 (reqts, " is not requirement list" );
844
807
845
- decodeRequirement<BuiltType, BuiltRequirement, BuiltInverseRequirement,
846
- BuiltLayoutConstraint, BuilderType>(
847
- reqts, requirements, inverseRequirements, Builder);
808
+ decodeRequirement<BuiltType, BuiltRequirement, BuiltLayoutConstraint,
809
+ BuilderType>(reqts, requirements, Builder);
848
810
849
811
return Builder.createConstrainedExistentialType (protocolType.getType (),
850
- requirements,
851
- inverseRequirements);
812
+ requirements);
852
813
}
853
814
case NodeKind::ConstrainedExistentialSelf:
854
815
return Builder.createGenericTypeParameterType (/* depth*/ 0 , /* index*/ 0 );
@@ -1319,7 +1280,6 @@ class TypeDecoder {
1319
1280
llvm::SmallVector<Field, 4 > fields;
1320
1281
llvm::SmallVector<BuiltSubstitution, 4 > substitutions;
1321
1282
llvm::SmallVector<BuiltRequirement, 4 > requirements;
1322
- llvm::SmallVector<BuiltInverseRequirement, 8 > inverseRequirements;
1323
1283
llvm::SmallVector<BuiltType, 4 > genericParams;
1324
1284
1325
1285
if (Node->getNumChildren () < 1 )
@@ -1372,10 +1332,10 @@ class TypeDecoder {
1372
1332
}
1373
1333
1374
1334
// Decode requirements.
1375
- decodeRequirement<BuiltType, BuiltRequirement, BuiltInverseRequirement ,
1376
- BuiltLayoutConstraint, BuilderType>(
1377
- dependentGenericSignatureNode, requirements, inverseRequirements ,
1378
- Builder);
1335
+ decodeRequirement<BuiltType, BuiltRequirement, BuiltLayoutConstraint ,
1336
+ BuilderType>(dependentGenericSignatureNode,
1337
+ requirements ,
1338
+ Builder);
1379
1339
1380
1340
// Decode substitutions.
1381
1341
for (unsigned i = 0 , e = substNode->getNumChildren (); i < e; ++i) {
@@ -1413,8 +1373,7 @@ class TypeDecoder {
1413
1373
}
1414
1374
1415
1375
return Builder.createSILBoxTypeWithLayout (fields, substitutions,
1416
- requirements,
1417
- inverseRequirements);
1376
+ requirements);
1418
1377
}
1419
1378
case NodeKind::SugaredOptional: {
1420
1379
if (Node->getNumChildren () < 1 )
0 commit comments