@@ -4600,17 +4600,17 @@ visitMagicIdentifierLiteralExpr(MagicIdentifierLiteralExpr *E, SGFContext C) {
46004600 llvm_unreachable (" Unhandled MagicIdentifierLiteralExpr in switch." );
46014601}
46024602
4603- static RValue emitSlabLiteral (SILGenFunction &SGF, CollectionExpr *E,
4603+ static RValue emitInlineArrayLiteral (SILGenFunction &SGF, CollectionExpr *E,
46044604 SGFContext C) {
46054605 ArgumentScope scope (SGF, E);
46064606
4607- auto slabType = E->getType ()->castTo <BoundGenericType>();
4608- auto loweredSlabType = SGF.getLoweredType (slabType );
4609- auto elementType = slabType ->getGenericArgs ()[1 ]->getCanonicalType ();
4607+ auto iaTy = E->getType ()->castTo <BoundGenericType>();
4608+ auto loweredIAType = SGF.getLoweredType (iaTy );
4609+ auto elementType = iaTy ->getGenericArgs ()[1 ]->getCanonicalType ();
46104610 auto loweredElementType = SGF.getLoweredType (elementType);
46114611 auto &eltTL = SGF.getTypeLowering (AbstractionPattern::getOpaque (), elementType);
46124612
4613- SILValue alloc = SGF.emitTemporaryAllocation (E, loweredSlabType );
4613+ SILValue alloc = SGF.emitTemporaryAllocation (E, loweredIAType );
46144614 SILValue addr = SGF.B .createUncheckedAddrCast (E, alloc,
46154615 loweredElementType.getAddressType ());
46164616
@@ -4643,31 +4643,31 @@ static RValue emitSlabLiteral(SILGenFunction &SGF, CollectionExpr *E,
46434643 .forwardInto (SGF, AbstractionPattern::getOpaque (), &init, eltTL);
46444644 }
46454645
4646- // Kill the per-element cleanups. The slab will take ownership of them.
4646+ // Kill the per-element cleanups. The inline array will take ownership of them.
46474647 for (auto destCleanup : cleanups)
46484648 SGF.Cleanups .setCleanupState (destCleanup, CleanupState::Dead);
46494649
4650- SILValue slabVal ;
4650+ SILValue iaVal ;
46514651
4652- // If the slab is naturally address-only, then we can adopt the stack slot
4653- // as the value directly.
4654- if (loweredSlabType .isAddressOnly (SGF.F )) {
4655- slabVal = SGF.B .createUncheckedAddrCast (E, alloc, loweredSlabType );
4652+ // If the inline array is naturally address-only, then we can adopt the stack
4653+ // slot as the value directly.
4654+ if (loweredIAType .isAddressOnly (SGF.F )) {
4655+ iaVal = SGF.B .createUncheckedAddrCast (E, alloc, loweredIAType );
46564656 } else {
4657- // Otherwise, this slab is loadable. Load it.
4658- slabVal = SGF.B .createTrivialLoadOr (E, alloc, LoadOwnershipQualifier::Take);
4657+ // Otherwise, this inline array is loadable. Load it.
4658+ iaVal = SGF.B .createTrivialLoadOr (E, alloc, LoadOwnershipQualifier::Take);
46594659 }
46604660
4661- auto slabMV = SGF.emitManagedRValueWithCleanup (slabVal );
4662- auto slab = RValue (SGF, E, slabMV );
4661+ auto iaMV = SGF.emitManagedRValueWithCleanup (iaVal );
4662+ auto ia = RValue (SGF, E, iaMV );
46634663
4664- return scope.popPreservingValue (std::move (slab ));
4664+ return scope.popPreservingValue (std::move (ia ));
46654665}
46664666
46674667RValue RValueEmitter::visitCollectionExpr (CollectionExpr *E, SGFContext C) {
4668- // Handle 'Slab ' literals separately.
4669- if (E->getType ()->isSlab ()) {
4670- return emitSlabLiteral (SGF, E, C);
4668+ // Handle 'InlineArray ' literals separately.
4669+ if (E->getType ()->isInlineArray ()) {
4670+ return emitInlineArrayLiteral (SGF, E, C);
46714671 }
46724672
46734673 auto loc = SILLocation (E);
0 commit comments