@@ -2973,7 +2973,7 @@ void irgen::emitLazyTypeContextDescriptor(IRGenModule &IGM,
29732973void irgen::emitLazyTypeMetadata (IRGenModule &IGM, NominalTypeDecl *type) {
29742974 // Embedded existentials emit very spares metadata records and don't have type
29752975 // context descriptors.
2976- if (!type-> getASTContext (). LangOpts . hasFeature (Feature::EmbeddedExistentials ))
2976+ if (!IGM. isEmbeddedWithExistentials ( ))
29772977 eraseExistingTypeContextDescriptor (IGM, type);
29782978
29792979 if (requiresForeignTypeMetadata (type)) {
@@ -4270,7 +4270,7 @@ namespace {
42704270 auto type = (Target->checkAncestry (AncestryFlags::ObjC)
42714271 ? IGM.Context .getAnyObjectType ()
42724272 : IGM.Context .TheNativeObjectType );
4273- if (IGM.Context . LangOpts . hasFeature (Feature::EmbeddedExistentials )) {
4273+ if (IGM.isEmbeddedWithExistentials ( )) {
42744274 return irgen::emitValueWitnessTable (IGM, type, false , false );
42754275 }
42764276 auto wtable = IGM.getAddrOfValueWitnessTable (type);
@@ -5577,9 +5577,8 @@ void irgen::emitLazyClassMetadata(IRGenModule &IGM, CanType classTy) {
55775577 // Might already be emitted, skip if that's the case.
55785578 auto entity =
55795579 LinkEntity::forTypeMetadata (classTy, TypeMetadataAddress::AddressPoint);
5580-
5581- auto isEmbeddedWithExistentials = IGM.Context .LangOpts .hasFeature (Feature::EmbeddedExistentials);
5582- if (isEmbeddedWithExistentials) {
5580+ auto hasEmbeddedWithExistentials = IGM.isEmbeddedWithExistentials ();
5581+ if (hasEmbeddedWithExistentials) {
55835582 entity = LinkEntity::forTypeMetadata (classTy, TypeMetadataAddress::FullMetadata);
55845583 }
55855584 auto *existingVar = cast<llvm::GlobalVariable>(
@@ -5588,7 +5587,7 @@ void irgen::emitLazyClassMetadata(IRGenModule &IGM, CanType classTy) {
55885587 return ;
55895588 }
55905589
5591- if (isEmbeddedWithExistentials ) {
5590+ if (hasEmbeddedWithExistentials ) {
55925591 emitEmbeddedClassMetadata (IGM, classTy->getClassOrBoundGenericClass ());
55935592 return ;
55945593 }
@@ -6225,8 +6224,7 @@ void irgen::emitStructMetadata(IRGenModule &IGM, StructDecl *structDecl) {
62256224
62266225 bool isPattern;
62276226 bool canBeConstant;
6228- bool hasEmbeddedExistentialFeature =
6229- IGM.Context .LangOpts .hasFeature (Feature::EmbeddedExistentials);
6227+ bool hasEmbeddedExistentialFeature = IGM.isEmbeddedWithExistentials ();
62306228 if (structDecl->isGenericContext ()) {
62316229 assert (!hasEmbeddedExistentialFeature);
62326230 GenericStructMetadataBuilder builder (IGM, structDecl, init);
@@ -6268,7 +6266,7 @@ void irgen::emitSpecializedGenericStructMetadata(IRGenModule &IGM, CanType type,
62686266 bool isPattern = false ;
62696267
62706268 SpecializedGenericStructMetadataBuilder builder (IGM, type, decl, init);
6271- if (IGM.Context . LangOpts . hasFeature (Feature::EmbeddedExistentials )) {
6269+ if (IGM.isEmbeddedWithExistentials ( )) {
62726270 builder.embeddedLayout ();
62736271 } else {
62746272 builder.layout ();
@@ -6315,7 +6313,7 @@ class TupleMetadataBuilder : public TupleMetadataVisitor<TupleMetadataBuilder> {
63156313};
63166314} // end anonymous namespace
63176315void irgen::emitLazyTupleMetadata (IRGenModule &IGM, CanType tupleTy) {
6318- assert (IGM.Context . LangOpts . hasFeature (Feature::EmbeddedExistentials ));
6316+ assert (IGM.isEmbeddedWithExistentials ( ));
63196317 assert (isa<TupleType>(tupleTy));
63206318
63216319 Type ty = tupleTy.getPointer ();
@@ -6374,7 +6372,7 @@ class FunctionMetadataBuilder : public FunctionMetadataVisitor<FunctionMetadataB
63746372} // end anonymous namespace
63756373
63766374void irgen::emitLazyFunctionMetadata (IRGenModule &IGM, CanType funTy) {
6377- assert (IGM.Context . LangOpts . hasFeature (Feature::EmbeddedExistentials ));
6375+ assert (IGM.isEmbeddedWithExistentials ( ));
63786376 assert (isa<FunctionType>(funTy));
63796377
63806378 Type ty = funTy.getPointer ();
@@ -6771,8 +6769,7 @@ void irgen::emitEnumMetadata(IRGenModule &IGM, EnumDecl *theEnum) {
67716769
67726770 bool isPattern;
67736771 bool canBeConstant;
6774- bool hasEmbeddedExistentialFeature =
6775- IGM.Context .LangOpts .hasFeature (Feature::EmbeddedExistentials);
6772+ bool hasEmbeddedExistentialFeature = IGM.isEmbeddedWithExistentials ();
67766773 if (theEnum->isGenericContext ()) {
67776774 assert (!hasEmbeddedExistentialFeature);
67786775 GenericEnumMetadataBuilder builder (IGM, theEnum, init);
@@ -6813,7 +6810,8 @@ void irgen::emitSpecializedGenericEnumMetadata(IRGenModule &IGM, CanType type,
68136810 init.setPacked (true );
68146811
68156812 SpecializedGenericEnumMetadataBuilder builder (IGM, type, decl, init);
6816- if (IGM.Context .LangOpts .hasFeature (Feature::EmbeddedExistentials)) {
6813+
6814+ if (IGM.isEmbeddedWithExistentials ()) {
68176815 builder.embeddedLayout ();
68186816 } else {
68196817 builder.layout ();
@@ -7202,8 +7200,7 @@ void irgen::emitForeignTypeMetadata(IRGenModule &IGM, NominalTypeDecl *decl) {
72027200 auto init = builder.beginStruct ();
72037201 init.setPacked (true );
72047202
7205- auto isEmbedded =
7206- IGM.Context .LangOpts .hasFeature (Feature::EmbeddedExistentials);
7203+ auto isEmbedded = IGM.isEmbeddedWithExistentials ();
72077204
72087205 if (auto classDecl = dyn_cast<ClassDecl>(decl)) {
72097206 if (classDecl->isForeignReferenceType ()) {
0 commit comments