@@ -4599,17 +4599,17 @@ visitMagicIdentifierLiteralExpr(MagicIdentifierLiteralExpr *E, SGFContext C) {
45994599 llvm_unreachable (" Unhandled MagicIdentifierLiteralExpr in switch." );
46004600}
46014601
4602- static RValue emitSlabLiteral (SILGenFunction &SGF, CollectionExpr *E,
4602+ static RValue emitInlineArrayLiteral (SILGenFunction &SGF, CollectionExpr *E,
46034603 SGFContext C) {
46044604 ArgumentScope scope (SGF, E);
46054605
4606- auto slabType = E->getType ()->castTo <BoundGenericType>();
4607- auto loweredSlabType = SGF.getLoweredType (slabType );
4608- auto elementType = slabType ->getGenericArgs ()[1 ]->getCanonicalType ();
4606+ auto iaTy = E->getType ()->castTo <BoundGenericType>();
4607+ auto loweredIAType = SGF.getLoweredType (iaTy );
4608+ auto elementType = iaTy ->getGenericArgs ()[1 ]->getCanonicalType ();
46094609 auto loweredElementType = SGF.getLoweredType (elementType);
46104610 auto &eltTL = SGF.getTypeLowering (AbstractionPattern::getOpaque (), elementType);
46114611
4612- SILValue alloc = SGF.emitTemporaryAllocation (E, loweredSlabType );
4612+ SILValue alloc = SGF.emitTemporaryAllocation (E, loweredIAType );
46134613 SILValue addr = SGF.B .createUncheckedAddrCast (E, alloc,
46144614 loweredElementType.getAddressType ());
46154615
@@ -4642,31 +4642,31 @@ static RValue emitSlabLiteral(SILGenFunction &SGF, CollectionExpr *E,
46424642 .forwardInto (SGF, AbstractionPattern::getOpaque (), &init, eltTL);
46434643 }
46444644
4645- // Kill the per-element cleanups. The slab will take ownership of them.
4645+ // Kill the per-element cleanups. The inline array will take ownership of them.
46464646 for (auto destCleanup : cleanups)
46474647 SGF.Cleanups .setCleanupState (destCleanup, CleanupState::Dead);
46484648
4649- SILValue slabVal ;
4649+ SILValue iaVal ;
46504650
4651- // If the slab is naturally address-only, then we can adopt the stack slot
4652- // as the value directly.
4653- if (loweredSlabType .isAddressOnly (SGF.F )) {
4654- slabVal = SGF.B .createUncheckedAddrCast (E, alloc, loweredSlabType );
4651+ // If the inline array is naturally address-only, then we can adopt the stack
4652+ // slot as the value directly.
4653+ if (loweredIAType .isAddressOnly (SGF.F )) {
4654+ iaVal = SGF.B .createUncheckedAddrCast (E, alloc, loweredIAType );
46554655 } else {
4656- // Otherwise, this slab is loadable. Load it.
4657- slabVal = SGF.B .createTrivialLoadOr (E, alloc, LoadOwnershipQualifier::Take);
4656+ // Otherwise, this inline array is loadable. Load it.
4657+ iaVal = SGF.B .createTrivialLoadOr (E, alloc, LoadOwnershipQualifier::Take);
46584658 }
46594659
4660- auto slabMV = SGF.emitManagedRValueWithCleanup (slabVal );
4661- auto slab = RValue (SGF, E, slabMV );
4660+ auto iaMV = SGF.emitManagedRValueWithCleanup (iaVal );
4661+ auto ia = RValue (SGF, E, iaMV );
46624662
4663- return scope.popPreservingValue (std::move (slab ));
4663+ return scope.popPreservingValue (std::move (ia ));
46644664}
46654665
46664666RValue RValueEmitter::visitCollectionExpr (CollectionExpr *E, SGFContext C) {
4667- // Handle 'Slab ' literals separately.
4668- if (E->getType ()->isSlab ()) {
4669- return emitSlabLiteral (SGF, E, C);
4667+ // Handle 'InlineArray ' literals separately.
4668+ if (E->getType ()->isInlineArray ()) {
4669+ return emitInlineArrayLiteral (SGF, E, C);
46704670 }
46714671
46724672 auto loc = SILLocation (E);
0 commit comments