diff --git a/include/swift/AST/AnyFunctionRef.h b/include/swift/AST/AnyFunctionRef.h index 3bcfbe1e6023e..f88f27f2a3f41 100644 --- a/include/swift/AST/AnyFunctionRef.h +++ b/include/swift/AST/AnyFunctionRef.h @@ -96,7 +96,7 @@ class AnyFunctionRef { Type getBodyResultType() const { if (auto *AFD = TheFunction.dyn_cast()) { if (auto *FD = dyn_cast(AFD)) - return FD->mapTypeIntoContext(FD->getResultInterfaceType()); + return FD->mapTypeIntoContext(FD->getResultInterfaceTypeWithoutYields()); return TupleType::getEmpty(AFD->getASTContext()); } return cast(TheFunction)->getResultType(); @@ -300,25 +300,7 @@ class AnyFunctionRef { private: ArrayRef getYieldResultsImpl(SmallVectorImpl &buffer, - bool mapIntoContext) const { - assert(buffer.empty()); - if (auto *AFD = TheFunction.dyn_cast()) { - if (auto *AD = dyn_cast(AFD)) { - if (AD->isCoroutine()) { - auto valueTy = AD->getStorage()->getValueInterfaceType() - ->getReferenceStorageReferent(); - if (mapIntoContext) - valueTy = AD->mapTypeIntoContext(valueTy); - YieldTypeFlags flags(isYieldingMutableAccessor(AD->getAccessorKind()) - ? ParamSpecifier::InOut - : ParamSpecifier::LegacyShared); - buffer.push_back(AnyFunctionType::Yield(valueTy, flags)); - return buffer; - } - } - } - return {}; - } + bool mapIntoContext) const; }; #if SWIFT_COMPILER_IS_MSVC #pragma warning(pop) diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index 9e21ad0bbd2ad..9fffeb4e0e758 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -7898,6 +7898,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl { /// attribute. bool isTransparent() const; + bool isCoroutine() const; + // Expose our import as member status ImportAsMemberStatus getImportAsMemberStatus() const { return ImportAsMemberStatus(Bits.AbstractFunctionDecl.IAMStatus); @@ -8525,9 +8527,15 @@ class FuncDecl : public AbstractFunctionDecl { return FnRetType.getSourceRange(); } - /// Retrieve the result interface type of this function. + /// Retrieve the full result interface type of this function, including yields Type getResultInterfaceType() const; + /// Same as above, but without @yields + Type getResultInterfaceTypeWithoutYields() const; + + /// Same as above, but only yields + Type getYieldsInterfaceType() const; + /// Returns the result interface type of this function if it has already been /// computed, otherwise `nullopt`. This should only be used for dumping. std::optional getCachedResultInterfaceType() const; diff --git a/include/swift/AST/DeclAttr.def b/include/swift/AST/DeclAttr.def index 3517bd718c87f..16744b37da80f 100644 --- a/include/swift/AST/DeclAttr.def +++ b/include/swift/AST/DeclAttr.def @@ -907,7 +907,12 @@ SIMPLE_DECL_ATTR(_unsafeSelfDependentResult, UnsafeSelfDependentResult, UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIBreakingToAdd | APIBreakingToRemove | EquivalentInABIAttr, 173) -LAST_DECL_ATTR(UnsafeSelfDependentResult) +SIMPLE_DECL_ATTR(yield_once, Coroutine, + OnFunc, + UserInaccessible | ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | EquivalentInABIAttr, + 174) + +LAST_DECL_ATTR(Coroutine) #undef DECL_ATTR_ALIAS #undef CONTEXTUAL_DECL_ATTR_ALIAS diff --git a/include/swift/AST/ExtInfo.h b/include/swift/AST/ExtInfo.h index 28f30af1d870b..55557d59023b9 100644 --- a/include/swift/AST/ExtInfo.h +++ b/include/swift/AST/ExtInfo.h @@ -323,7 +323,7 @@ enum class SILFunctionTypeRepresentation : uint8_t { CFunctionPointer = uint8_t(FunctionTypeRepresentation::CFunctionPointer), /// The value of the greatest AST function representation. - LastAST = CFunctionPointer, + LastAST = uint8_t(FunctionTypeRepresentation::Last), /// The value of the least SIL-only function representation. FirstSIL = 8, @@ -523,8 +523,8 @@ class ASTExtInfoBuilder { // If bits are added or removed, then TypeBase::NumAFTExtInfoBits // and NumMaskBits must be updated, and they must match. // - // |representation|noEscape|concurrent|async|throws|isolation|differentiability| SendingResult | - // | 0 .. 3 | 4 | 5 | 6 | 7 | 8 .. 10 | 11 .. 13 | 14 | + // |representation|noEscape|concurrent|async|throws|isolation|differentiability| SendingResult | InOutResult | coroutine | + // | 0 .. 3 | 4 | 5 | 6 | 7 | 8 .. 10 | 11 .. 13 | 14 | 15 | 16 | // enum : unsigned { RepresentationMask = 0xF << 0, @@ -538,7 +538,8 @@ class ASTExtInfoBuilder { DifferentiabilityMask = 0x7 << DifferentiabilityMaskOffset, SendingResultMask = 1 << 14, InOutResultMask = 1 << 15, - NumMaskBits = 16 + CoroutineMask = 1 << 16, + NumMaskBits = 17 }; static_assert(FunctionTypeIsolation::Mask == 0x7, "update mask manually"); @@ -617,6 +618,8 @@ class ASTExtInfoBuilder { constexpr bool hasSendingResult() const { return bits & SendingResultMask; } + constexpr bool isCoroutine() const { return bits & CoroutineMask; } + constexpr DifferentiabilityKind getDifferentiabilityKind() const { return DifferentiabilityKind((bits & DifferentiabilityMask) >> DifferentiabilityMaskOffset); @@ -735,6 +738,13 @@ class ASTExtInfoBuilder { clangTypeInfo, globalActor, thrownError, lifetimeDependencies); } + [[nodiscard]] + ASTExtInfoBuilder withCoroutine(bool coroutine = true) const { + return ASTExtInfoBuilder( + coroutine ? (bits | CoroutineMask) : (bits & ~CoroutineMask), + clangTypeInfo, globalActor, thrownError, lifetimeDependencies); + } + [[nodiscard]] ASTExtInfoBuilder withDifferentiabilityKind(DifferentiabilityKind differentiability) const { @@ -862,6 +872,8 @@ class ASTExtInfo { constexpr bool isThrowing() const { return builder.isThrowing(); } + constexpr bool isCoroutine() const { return builder.isCoroutine(); } + constexpr bool hasSendingResult() const { return builder.hasSendingResult(); } constexpr DifferentiabilityKind getDifferentiabilityKind() const { @@ -927,6 +939,14 @@ class ASTExtInfo { return builder.withThrows(true, Type()).build(); } + /// Helper method for changing only the coroutine field. + /// + /// Prefer using \c ASTExtInfoBuilder::withCoroutine for chaining. + [[nodiscard]] + ASTExtInfo withCoroutine(bool coroutine = true) const { + return builder.withCoroutine(coroutine).build(); + } + /// Helper method for changing only the async field. /// /// Prefer using \c ASTExtInfoBuilder::withAsync for chaining. diff --git a/include/swift/AST/TypeAttr.def b/include/swift/AST/TypeAttr.def index eed13ab321f9c..83389cbbf410c 100644 --- a/include/swift/AST/TypeAttr.def +++ b/include/swift/AST/TypeAttr.def @@ -68,6 +68,9 @@ TYPE_ATTR(isolated, Isolated) SIMPLE_TYPE_ATTR(nonisolated, Nonisolated) SIMPLE_TYPE_ATTR(_addressable, Addressable) SIMPLE_TYPE_ATTR(concurrent, Concurrent) +SIMPLE_TYPE_ATTR(yields, Yields) +SIMPLE_TYPE_ATTR(yield_once, YieldOnce) +SIMPLE_TYPE_ATTR(yield_once_2, YieldOnce2) // SIL-specific attributes SIMPLE_SIL_TYPE_ATTR(async, Async) @@ -104,9 +107,6 @@ SIL_TYPE_ATTR(opened, Opened) SIL_TYPE_ATTR(pack_element, PackElement) SIMPLE_SIL_TYPE_ATTR(pseudogeneric, Pseudogeneric) SIMPLE_SIL_TYPE_ATTR(unimplementable, Unimplementable) -SIMPLE_SIL_TYPE_ATTR(yields, Yields) -SIMPLE_SIL_TYPE_ATTR(yield_once, YieldOnce) -SIMPLE_SIL_TYPE_ATTR(yield_once_2, YieldOnce2) SIMPLE_SIL_TYPE_ATTR(yield_many, YieldMany) SIMPLE_SIL_TYPE_ATTR(captures_generics, CapturesGenerics) // Used at the SIL level to mark a type as moveOnly. diff --git a/include/swift/AST/TypeDifferenceVisitor.h b/include/swift/AST/TypeDifferenceVisitor.h index 04aade617a043..b839bfcfb63c7 100644 --- a/include/swift/AST/TypeDifferenceVisitor.h +++ b/include/swift/AST/TypeDifferenceVisitor.h @@ -187,6 +187,10 @@ class CanTypeDifferenceVisitor : public CanTypePairVisitor { type1->getElements(), type2->getElements()); } + bool visitYieldResultType(CanYieldResultType type1, CanYieldResultType type2) { + return asImpl().visit(type1.getResultType(), type2.getResultType()); + } + bool visitComponent(CanType type1, CanType type2, const TupleTypeElt &elt1, const TupleTypeElt &elt2) { if (elt1.getName() != elt2.getName()) diff --git a/include/swift/AST/TypeMatcher.h b/include/swift/AST/TypeMatcher.h index 5bf1b37bbb363..9c2f10d7fb047 100644 --- a/include/swift/AST/TypeMatcher.h +++ b/include/swift/AST/TypeMatcher.h @@ -147,6 +147,17 @@ class TypeMatcher { return mismatch(firstTuple.getPointer(), secondType, sugaredFirstType); } + bool visitYieldResultType(CanYieldResultType firstType, Type secondType, + Type sugaredFirstType) { + if (auto secondYieldType = secondType->getAs()) + if (!this->visit(firstType.getResultType(), + secondYieldType->getResultType(), + sugaredFirstType->getAs()->getResultType())) + return false; + + return mismatch(firstType.getPointer(), secondType, sugaredFirstType); + } + bool visitSILPackType(CanSILPackType firstPack, Type secondType, Type sugaredFirstType) { if (auto secondPack = secondType->getAs()) { diff --git a/include/swift/AST/TypeNodes.def b/include/swift/AST/TypeNodes.def index b49e9958dd86e..e92e90cccbb0f 100644 --- a/include/swift/AST/TypeNodes.def +++ b/include/swift/AST/TypeNodes.def @@ -207,6 +207,7 @@ TYPE(InOut, Type) TYPE(Pack, Type) TYPE(PackExpansion, Type) TYPE(PackElement, Type) +TYPE(YieldResult, Type) UNCHECKED_TYPE(TypeVariable, Type) UNCHECKED_TYPE(ErrorUnion, Type) TYPE(Integer, Type) diff --git a/include/swift/AST/TypeTransform.h b/include/swift/AST/TypeTransform.h index a1558d15a54c3..988a43bbee8c6 100644 --- a/include/swift/AST/TypeTransform.h +++ b/include/swift/AST/TypeTransform.h @@ -1038,6 +1038,16 @@ case TypeKind::Id: t : InOutType::get(objectTy); } + case TypeKind::YieldResult: { + auto yield = cast(base); + auto objectTy = doIt(yield->getResultType(), TypePosition::Invariant); + if (!objectTy || objectTy->hasError()) + return objectTy; + + return objectTy.getPointer() == yield->getResultType().getPointer() ? + t : YieldResultType::get(objectTy, yield->isInOut()); + } + case TypeKind::Existential: { auto *existential = cast(base); auto constraint = doIt(existential->getConstraintType(), pos); diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 1b4a9b2571b09..3439fcbef178f 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -409,7 +409,7 @@ class alignas(1 << TypeAlignInBits) TypeBase } protected: - enum { NumAFTExtInfoBits = 16 }; + enum { NumAFTExtInfoBits = 17 }; enum { NumSILExtInfoBits = 14 }; // clang-format off @@ -1712,6 +1712,37 @@ class ErrorType final : public TypeBase { } }; DEFINE_EMPTY_CAN_TYPE_WRAPPER(ErrorType, Type) + +class YieldResultType : public TypeBase { + Type ResultType; + bool InOut = false; + + YieldResultType(Type objectTy, bool InOut, const ASTContext *canonicalContext, + RecursiveTypeProperties properties) + : TypeBase(TypeKind::YieldResult, canonicalContext, properties), + ResultType(objectTy), InOut(InOut) {} + +public: + static YieldResultType *get(Type originalType, bool InOut); + + Type getResultType() const { return ResultType; } + bool isInOut() const { return InOut; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const TypeBase *T) { + return T->getKind() == TypeKind::YieldResult; + } +}; + +BEGIN_CAN_TYPE_WRAPPER(YieldResultType, Type) + PROXY_CAN_TYPE_SIMPLE_GETTER(getResultType) + bool isInOut() const { + return getPointer()->isInOut(); + } + static CanYieldResultType get(CanType type, bool InOut) { + return CanYieldResultType(YieldResultType::get(type, InOut)); + } +END_CAN_TYPE_WRAPPER(YieldResultType, Type) /// BuiltinType - An abstract class for all the builtin types. class BuiltinType : public TypeBase { @@ -3938,6 +3969,9 @@ class AnyFunctionType : public TypeBase { /// Return the function type setting sendable to \p newValue. AnyFunctionType *withSendable(bool newValue) const; + /// Return the function type without yields (and coroutine flag) + AnyFunctionType *getWithoutYields() const; + /// True if the parameter declaration it is attached to is guaranteed /// to not persist the closure for longer than the duration of the call. bool isNoEscape() const { @@ -3950,6 +3984,8 @@ class AnyFunctionType : public TypeBase { bool isThrowing() const { return getExtInfo().isThrowing(); } + bool isCoroutine() const { return getExtInfo().isCoroutine(); } + bool hasSendingResult() const { return getExtInfo().hasSendingResult(); } bool hasEffect(EffectKind kind) const; diff --git a/include/swift/Demangling/DemangleNodes.def b/include/swift/Demangling/DemangleNodes.def index d74f6a902ae89..d8e559616712e 100644 --- a/include/swift/Demangling/DemangleNodes.def +++ b/include/swift/Demangling/DemangleNodes.def @@ -418,6 +418,8 @@ NODE(DependentGenericParamValueMarker) NODE(CoroFunctionPointer) NODE(DefaultOverride) NODE(ConstValue) +NODE(YieldResult) +NODE(Coroutine) // Added in Swift 6.TBD CONTEXT_NODE(BorrowAccessor) diff --git a/include/swift/Parse/Parser.h b/include/swift/Parse/Parser.h index 9877dfddc848a..6aab58420ee0b 100644 --- a/include/swift/Parse/Parser.h +++ b/include/swift/Parse/Parser.h @@ -586,8 +586,8 @@ class Parser { bool isContextualYieldKeyword() { return (Tok.isContextualKeyword("yield") && - isa(CurDeclContext) && - cast(CurDeclContext)->isCoroutine()); + (isa(CurDeclContext) && + cast(CurDeclContext)->isCoroutine())); } /// Whether the current token is the contextual keyword for a \c then diff --git a/include/swift/SIL/AbstractionPattern.h b/include/swift/SIL/AbstractionPattern.h index 38eb1319d674f..6b22c4e62c226 100644 --- a/include/swift/SIL/AbstractionPattern.h +++ b/include/swift/SIL/AbstractionPattern.h @@ -1526,7 +1526,7 @@ class AbstractionPattern { /// Given that the value being abstracted is a function, return the /// abstraction pattern for its result type. - AbstractionPattern getFunctionResultType() const; + AbstractionPattern getFunctionResultType(bool withoutYields = false) const; /// Given that the value being abstracted is a function, return the /// abstraction pattern for its thrown error type. diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e1c7f80493ee3..9a17bf2449ea9 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -574,6 +574,8 @@ struct ASTContext::Implementation { llvm::DenseMap ReferenceStorageTypes; llvm::DenseMap LValueTypes; llvm::DenseMap InOutTypes; + llvm::DenseMap, + YieldResultType*> YieldResultTypes; llvm::DenseMap, DependentMemberType *> DependentMemberTypes; llvm::FoldingSet ErrorUnionTypes; @@ -3380,6 +3382,7 @@ size_t ASTContext::Implementation::Arena::getTotalMemory() const { llvm::capacity_in_bytes(ReferenceStorageTypes) + llvm::capacity_in_bytes(LValueTypes) + llvm::capacity_in_bytes(InOutTypes) + + llvm::capacity_in_bytes(YieldResultTypes) + llvm::capacity_in_bytes(DependentMemberTypes) + llvm::capacity_in_bytes(EnumTypes) + llvm::capacity_in_bytes(StructTypes) + @@ -3418,6 +3421,7 @@ void ASTContext::Implementation::Arena::dump(llvm::raw_ostream &os) const { SIZE_AND_BYTES(ReferenceStorageTypes); SIZE_AND_BYTES(LValueTypes); SIZE_AND_BYTES(InOutTypes); + SIZE_AND_BYTES(YieldResultTypes); SIZE_AND_BYTES(DependentMemberTypes); SIZE(ErrorUnionTypes); SIZE_AND_BYTES(PlaceholderTypes); @@ -5717,6 +5721,28 @@ InOutType *InOutType::get(Type objectTy) { properties); } +YieldResultType *YieldResultType::get(Type objectTy, bool InOut) { + auto properties = objectTy->getRecursiveProperties(); + if (InOut) { + assert(!objectTy->is() && !objectTy->is() && + "cannot have 'inout' or @lvalue wrapped inside an 'inout yield'"); + properties &= ~RecursiveTypeProperties::IsLValue; + } + + auto arena = getArena(properties); + + auto &C = objectTy->getASTContext(); + auto pair = llvm::PointerIntPair(objectTy.getPointer(), + InOut); + auto &entry = C.getImpl().getArena(arena).YieldResultTypes[pair]; + if (entry) + return entry; + + const ASTContext *canonicalContext = objectTy->isCanonical() ? &C : nullptr; + return entry = new (C, arena) YieldResultType(objectTy, InOut, canonicalContext, + properties); +} + DependentMemberType *DependentMemberType::get(Type base, Identifier name) { auto properties = base->getRecursiveProperties(); properties |= RecursiveTypeProperties::HasDependentMember; diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index d121ffc015674..d70aa4f1f71fe 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -2864,6 +2864,7 @@ namespace { void printCommonFD(FuncDecl *FD, const char *type, Label label) { printCommonAFD(FD, type, label); printFlag(FD->isStatic(), "static", DeclModifierColor); + printFlag(FD->isCoroutine(), "@yield_once", DeclModifierColor); } void visitFuncDecl(FuncDecl *FD, Label label) { @@ -5019,6 +5020,7 @@ class PrintAttribute : public AttributeVisitor, TRIVIAL_ATTR_PRINTER(CompilerInitialized, compiler_initialized) TRIVIAL_ATTR_PRINTER(Consuming, consuming) TRIVIAL_ATTR_PRINTER(Convenience, convenience) + TRIVIAL_ATTR_PRINTER(Coroutine, coroutine) TRIVIAL_ATTR_PRINTER(DiscardableResult, discardable_result) TRIVIAL_ATTR_PRINTER(DisfavoredOverload, disfavored_overload) TRIVIAL_ATTR_PRINTER(DistributedActor, distributed_actor) @@ -6115,6 +6117,13 @@ namespace { printFoot(); } + void visitYieldResultType(YieldResultType *T, Label label) { + printCommon("yield", label); + printFlag(T->isInOut(), "inout"); + printRec(T->getResultType(), Label::always("type")); + printFoot(); + } + void visitPlaceholderType(PlaceholderType *T, Label label) { printCommon("placeholder_type", label); auto originator = T->getOriginator(); @@ -6536,6 +6545,7 @@ namespace { printFlag(T->isAsync(), "async"); printFlag(T->isThrowing(), "throws"); printFlag(T->hasSendingResult(), "sending_result"); + printFlag(T->isCoroutine(), "@yield_once"); if (T->isDifferentiable()) { switch (T->getDifferentiabilityKind()) { default: diff --git a/lib/AST/ASTMangler.cpp b/lib/AST/ASTMangler.cpp index 6d88e666e7d2b..c98e42c24ef19 100644 --- a/lib/AST/ASTMangler.cpp +++ b/lib/AST/ASTMangler.cpp @@ -1894,6 +1894,11 @@ void ASTMangler::appendType(Type type, GenericSignature sig, return; } + case TypeKind::YieldResult: + appendType(cast(tybase)->getResultType(), sig, forDecl); + appendOperator("Yy"); + return; + case TypeKind::SILMoveOnlyWrapped: // If we hit this, we just mangle the underlying name and move on. llvm_unreachable("should never be mangled?"); @@ -3339,6 +3344,8 @@ void ASTMangler::appendFunctionType(AnyFunctionType *fn, GenericSignature sig, } else if (fn->isNoEscape()) { return appendOperator("XE"); } + if (fn->isCoroutine()) + return appendOperator("Xy"); return appendOperator("c"); case AnyFunctionType::Representation::CFunctionPointer: @@ -3594,7 +3601,10 @@ void ASTMangler::appendParameterTypeListElement( GenericSignature sig, const ValueDecl *forDecl) { if (auto *fnType = elementType->getAs()) appendFunctionType(fnType, sig, flags.isAutoClosure(), forDecl); - else + else if (auto *yieldType = elementType->getAs()) { + appendType(yieldType->getResultType(), sig, forDecl); + appendOperator("Yy"); + } else appendType(elementType, sig, forDecl); if (flags.isNoDerivative()) { diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index a23fb9734682e..0a79b69d793c4 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -6263,6 +6263,13 @@ class TypePrinter : public TypeVisitorisInOut()) + Printer << "inout "; + Printer << "@yields "; + visit(T->getResultType()); + } void visitErrorUnionType(ErrorUnionType *T, NonRecursivePrintOptions nrOptions) { @@ -6694,6 +6701,10 @@ class TypePrinter : public TypeVisitor buf; switch (Options.PrintFunctionRepresentationAttrs) { case PrintOptions::FunctionRepresentationMode::None: diff --git a/lib/AST/ASTVerifier.cpp b/lib/AST/ASTVerifier.cpp index dca0ef13b3bd1..af303e1207f2a 100644 --- a/lib/AST/ASTVerifier.cpp +++ b/lib/AST/ASTVerifier.cpp @@ -1100,7 +1100,7 @@ class Verifier : public ASTWalker { bool hasInOutResult = false; if (auto *FD = dyn_cast(func)) { - resultType = FD->getResultInterfaceType(); + resultType = FD->getResultInterfaceTypeWithoutYields(); resultType = FD->mapTypeIntoContext(resultType); hasInOutResult = FD->getInterfaceType() ->castTo() diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 9ad2c3c8f61c4..0fc2a8de69413 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1365,6 +1365,58 @@ bool AbstractFunctionDecl::isTransparent() const { return false; } +bool AbstractFunctionDecl::isCoroutine() const { + // Check if the declaration had the attribute. + if (getAttrs().hasAttribute()) + return true; + + // If this is an accessor, then check if its a coroutine. + if (const auto *AD = dyn_cast(this)) + return AD->isCoroutine(); + + return false; +} + +ArrayRef +AnyFunctionRef::getYieldResultsImpl(SmallVectorImpl &buffer, + bool mapIntoContext) const { + assert(buffer.empty()); + if (auto *AFD = getAbstractFunctionDecl()) { + if (AFD->isCoroutine()) { + auto fnType = AFD->getInterfaceType(); + if (fnType->hasError()) + return {}; + + auto resType = fnType->castTo()->getResult(); + if (auto *resFnType = resType->getAs()) + resType = resFnType->getResult(); + + auto addYieldInfo = + [&](const YieldResultType *yieldResultTy) { + Type valueTy = yieldResultTy->getResultType(); + if (mapIntoContext) + valueTy = AFD->mapTypeIntoContext(valueTy); + YieldTypeFlags flags(yieldResultTy->isInOut() ? + ParamSpecifier::InOut : ParamSpecifier::LegacyShared); + buffer.push_back(AnyFunctionType::Yield(valueTy, flags)); + }; + + if (auto *tupleResTy = resType->getAs()) + for (const auto &elt : tupleResTy->getElements()) { + Type eltTy = elt.getType(); + if (auto *yieldResTy = eltTy->getAs()) + addYieldInfo(yieldResTy); + } + else if (auto *yieldResTy = resType->getAs()) + addYieldInfo(yieldResTy); + + return buffer; + } + } + return {}; +} + + bool ParameterList::hasInternalParameter(StringRef Prefix) const { for (auto param : *this) { if (param->hasName() && param->getNameStr().starts_with(Prefix)) @@ -4109,6 +4161,7 @@ mapSignatureExtInfo(AnyFunctionType::ExtInfo info, .withAsync(info.isAsync()) .withThrows(info.isThrowing(), info.getThrownError()) .withClangFunctionType(info.getClangTypeInfo().getType()) + .withCoroutine(info.isCoroutine()) .build(); } @@ -11409,6 +11462,66 @@ std::optional FuncDecl::getCachedResultInterfaceType() const { return ResultTypeRequest{mutableThis}.getCachedResult(); } +Type FuncDecl::getResultInterfaceTypeWithoutYields() const { + auto resultType = getResultInterfaceType(); + if (resultType->hasError()) + return resultType; + + // Coroutine result type should either be a yield result + // or a tuple containing both yielded and normal result types. + // In both cases, strip the @yield result types + if (isCoroutine()) { + if (auto *tupleResTy = resultType->getAs()) { + // Strip @yield results on the first level of tuple + SmallVector elements; + for (const auto &elt : tupleResTy->getElements()) { + Type eltTy = elt.getType(); + if (eltTy->is()) + continue; + elements.push_back(elt); + } + + // Handle vanishing tuples -- flatten to produce the + // element type. + if (elements.size() == 1) + resultType = elements[0].getType(); + else + resultType = TupleType::get(elements, getASTContext()); + } else if (resultType->is()) { + resultType = TupleType::getEmpty(getASTContext()); + } + } + + return resultType; +} + +Type FuncDecl::getYieldsInterfaceType() const { + auto resultType = getResultInterfaceType(); + if (resultType->hasError()) + return resultType; + + if (!isCoroutine()) + return TupleType::getEmpty(getASTContext()); + + // Coroutine result type should either be a yield result + // or a tuple containing both yielded and normal result types. + // In both cases, strip the @yield result types + if (auto *tupleResTy = resultType->getAs()) { + // Keep @yield results on the first level of tuple + for (const auto &elt : tupleResTy->getElements()) { + Type eltTy = elt.getType(); + if (eltTy->is()) + return eltTy; + } + + llvm_unreachable("coroutine must have a yield result"); + } else if (resultType->is()) { + return resultType; + } + + return ErrorType::get(getASTContext()); +} + bool FuncDecl::isUnaryOperator() const { if (!isOperator()) return false; diff --git a/lib/AST/ExistentialGeneralization.cpp b/lib/AST/ExistentialGeneralization.cpp index d12e2df63b305..3aee5d748fbd9 100644 --- a/lib/AST/ExistentialGeneralization.cpp +++ b/lib/AST/ExistentialGeneralization.cpp @@ -85,6 +85,12 @@ class Generalizer : public CanTypeVisitor { return type; } + // FIXME: Decide if we can generalize yield results at all + Type visitYieldResultType(CanYieldResultType origType) { + return YieldResultType::get(generalizeStructure(origType.getResultType()), + origType->isInOut()); + } + Type visitParameterizedProtocolType(CanParameterizedProtocolType origType) { // Generalize the argument types of parameterized protocols, // but don't generalize the base type. diff --git a/lib/AST/LifetimeDependence.cpp b/lib/AST/LifetimeDependence.cpp index 6e6612c29f5fe..c7052ff7c87b1 100644 --- a/lib/AST/LifetimeDependence.cpp +++ b/lib/AST/LifetimeDependence.cpp @@ -677,7 +677,8 @@ class LifetimeDependenceChecker { // needs one. Always runs before the checker completes if no other diagnostics // were issued. void diagnoseMissingResultDependencies(DiagID diagID) { - if (!isDiagnosedNonEscapable(getResultOrYield())) { + if (!isDiagnosedNonEscapable(getResultWithoutYield()) && + !isDiagnosedNonEscapable(getYields())) { return; } if (!depBuilder.hasTargetDeps(resultIndex)) { @@ -789,23 +790,35 @@ class LifetimeDependenceChecker { loweredOwnership == ValueOwnership::InOut; } - Type getResultOrYield() const { + Type getResultWithoutYield() const { auto *afd = cast(decl); - if (auto *accessor = dyn_cast(afd)) { - if (accessor->isCoroutine()) { - auto yieldTyInContext = accessor->mapTypeIntoContext( - accessor->getStorage()->getValueInterfaceType()); - return yieldTyInContext; - } - } Type resultType; if (auto fn = dyn_cast(afd)) { - resultType = fn->getResultInterfaceType(); + resultType = fn->getResultInterfaceTypeWithoutYields(); } else { auto ctor = cast(afd); resultType = ctor->getResultInterfaceType(); } - return afd->mapTypeIntoContext(resultType); + resultType = afd->mapTypeIntoContext(resultType); + if (resultType->isEqual(afd->getASTContext().TheEmptyTupleType)) + return ErrorType::get(afd->getASTContext()); + + return resultType; + } + + Type getYields() const { + auto *afd = cast(decl); + if (auto fn = dyn_cast(afd)) { + auto yieldType = afd->mapTypeIntoContext(fn->getYieldsInterfaceType()); + if (yieldType->isEqual(afd->getASTContext().TheEmptyTupleType)) + return ErrorType::get(afd->getASTContext()); + + if (yieldType->hasError()) + return yieldType; + + return yieldType->getAs()->getResultType(); + } + return ErrorType::get(afd->getASTContext()); } // ========================================================================== @@ -973,10 +986,14 @@ class LifetimeDependenceChecker { } targetIndex = targetDeclAndIndex->second; } else { - if (isDiagnosedEscapable(getResultOrYield())) { + if (isDiagnosedEscapable(getResultWithoutYield())) { diagnose(entry->getLoc(), diag::lifetime_target_requires_nonescapable, "result"); + } else if (isDiagnosedEscapable(getYields())) { + diagnose(entry->getLoc(), diag::lifetime_target_requires_nonescapable, + "yield"); } + targetIndex = afd->hasImplicitSelfDecl() ? afd->getParameters()->size() + 1 : afd->getParameters()->size(); @@ -1103,7 +1120,8 @@ class LifetimeDependenceChecker { } // Infer non-Escapable results. - if (isDiagnosedNonEscapable(getResultOrYield())) { + if (isDiagnosedNonEscapable(getResultWithoutYield()) || + isDiagnosedNonEscapable(getYields())) { if (isInit() && isImplicitOrSIL()) { inferImplicitInit(); } else if (hasImplicitSelfParam()) { @@ -1211,7 +1229,8 @@ class LifetimeDependenceChecker { // error. std::optional getImplicitAccessorResultDependence(AccessorDecl *accessor) { - if (!isDiagnosedNonEscapable(getResultOrYield())) + if (!isDiagnosedNonEscapable(getResultWithoutYield()) && + !isDiagnosedNonEscapable(getYields())) return std::nullopt; std::optional wrappedAccessorKind = std::nullopt; diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 26de2d02a112d..c6ab41b25d4e3 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -277,6 +277,10 @@ bool CanType::isReferenceTypeImpl(CanType type, const GenericSignatureImpl *sig, #include "swift/AST/ReferenceStorage.def" return false; + case TypeKind::YieldResult: + return isReferenceTypeImpl(cast(type).getResultType(), + sig, functionsCount); + case TypeKind::GenericTypeParam: case TypeKind::DependentMember: assert(sig && "dependent types can't answer reference semantics query"); @@ -1859,6 +1863,13 @@ CanType TypeBase::computeCanonicalType() { break; } + case TypeKind::YieldResult: { + auto *ty = cast(this); + auto wrappedType = ty->getResultType()->getCanonicalType(); + Result = YieldResultType::get(wrappedType, ty->isInOut()); + break; + } + case TypeKind::Tuple: { TupleType *TT = cast(this); assert(TT->getNumElements() != 0 && "Empty tuples are always canonical"); @@ -4587,6 +4598,9 @@ ReferenceCounting TypeBase::getReferenceCounting() { ->getInnerType() ->getReferenceCounting(); + case TypeKind::YieldResult: + return cast(type)->getResultType()->getReferenceCounting(); + case TypeKind::PrimaryArchetype: case TypeKind::ExistentialArchetype: case TypeKind::OpaqueTypeArchetype: @@ -4738,6 +4752,39 @@ AnyFunctionType *AnyFunctionType::withSendable(bool newValue) const { return withExtInfo(info); } +AnyFunctionType *AnyFunctionType::getWithoutYields() const { + auto resultType = getResult(); + + if (auto *tupleResTy = resultType->getAs()) { + // Strip @yield results on the first level of tuple + SmallVector elements; + for (const auto &elt : tupleResTy->getElements()) { + Type eltTy = elt.getType(); + if (eltTy->is()) + continue; + elements.push_back(elt); + } + + // Handle vanishing tuples -- flatten to produce the + // normal coroutine result type + if (elements.size() == 1 && isCoroutine()) + resultType = elements[0].getType(); + else + resultType = TupleType::get(elements, getASTContext()); + } else if (resultType->is()) { + resultType = TupleType::getEmpty(getASTContext()); + } + + auto noCoroExtInfo = getExtInfo().intoBuilder() + .withCoroutine(false) + .build(); + if (isa(this)) + return FunctionType::get(getParams(), resultType, noCoroExtInfo); + assert(isa(this)); + return GenericFunctionType::get(getOptGenericSignature(), getParams(), + resultType, noCoroExtInfo); +} + std::optional AnyFunctionType::getEffectiveThrownErrorType() const { // A non-throwing function... has no thrown interface type. if (!isThrowing()) diff --git a/lib/AST/TypeWalker.cpp b/lib/AST/TypeWalker.cpp index e236dece27527..b45c8bfe274bc 100644 --- a/lib/AST/TypeWalker.cpp +++ b/lib/AST/TypeWalker.cpp @@ -57,6 +57,10 @@ class Traversal : public TypeVisitor bool visitSILTokenType(SILTokenType *ty) { return false; } + bool visitYieldResultType(YieldResultType *ty) { + return doIt(ty->getResultType()); + } + bool visitPackType(PackType *ty) { for (auto elementTy : ty->getElementTypes()) if (doIt(elementTy)) diff --git a/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift b/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift index 5e66153edcd3e..301053829ef31 100644 --- a/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift +++ b/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift @@ -208,6 +208,8 @@ extension ASTGenVisitor { return handle(self.generateSimpleDeclAttr(attribute: node, kind: .AtRethrows)) case .Concurrent: return handle(self.generateSimpleDeclAttr(attribute: node, kind: .Concurrent)) + case .Coroutine: + fatalError("unimplemented") case nil where attrName == "_unavailableInEmbedded": return handle(self.generateUnavailableInEmbeddedAttr(attribute: node)?.asDeclAttribute) diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index 79d469ff55808..8210c4507d089 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -2132,6 +2132,7 @@ class GetSendableType : VISIT(ExistentialType, recurse) NEVER_VISIT(LValueType) VISIT(InOutType, recurse) + NEVER_VISIT(YieldResultType) NEVER_VISIT(PackType) NEVER_VISIT(PackExpansionType) diff --git a/lib/Demangling/Demangler.cpp b/lib/Demangling/Demangler.cpp index d6e9eb3fb3116..12bdbb1f73e24 100644 --- a/lib/Demangling/Demangler.cpp +++ b/lib/Demangling/Demangler.cpp @@ -1018,6 +1018,9 @@ NodePointer Demangler::demangleTypeAnnotation() { case 'u': return createType( createWithChild(Node::Kind::Sending, popTypeAndGetChild())); + case 'y': + return createType( + createWithChild(Node::Kind::YieldResult, popTypeAndGetChild())); default: return nullptr; } @@ -3896,6 +3899,8 @@ NodePointer Demangler::demangleSpecialType() { return popFunctionType(Node::Kind::ObjCBlock); case 'C': return popFunctionType(Node::Kind::CFunctionPointer); + case 'y': + return popFunctionType(Node::Kind::Coroutine); case 'g': case 'G': return demangleExtendedExistentialShape(specialChar); diff --git a/lib/Demangling/NodePrinter.cpp b/lib/Demangling/NodePrinter.cpp index 6762fadefa8a6..a7b85dec0867c 100644 --- a/lib/Demangling/NodePrinter.cpp +++ b/lib/Demangling/NodePrinter.cpp @@ -624,6 +624,8 @@ bool NodePrinter::isSimpleType(NodePointer Node) { case Node::Kind::DefaultOverride: case Node::Kind::BorrowAccessor: case Node::Kind::MutateAccessor: + case Node::Kind::YieldResult: + case Node::Kind::Coroutine: return false; } printer_unreachable("bad node kind"); @@ -1809,6 +1811,14 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth, Printer << "inout "; print(Node->getChild(0), depth + 1); return nullptr; + case Node::Kind::YieldResult: + Printer << "@yields "; + print(Node->getChild(0), depth + 1); + return nullptr; + case Node::Kind::Coroutine: + Printer << "@yield_once "; + print(Node->getChild(0), depth + 1); + return nullptr; case Node::Kind::Isolated: Printer << "isolated "; print(Node->getChild(0), depth + 1); diff --git a/lib/Demangling/OldRemangler.cpp b/lib/Demangling/OldRemangler.cpp index 199e4dac12611..501512b88fe70 100644 --- a/lib/Demangling/OldRemangler.cpp +++ b/lib/Demangling/OldRemangler.cpp @@ -1823,6 +1823,16 @@ ManglingError Remangler::mangleImplInvocationSubstitutions(Node *node, return ManglingError::Success; } +ManglingError Remangler::mangleYieldResult(Node *node, unsigned depth) { + // The old mangler does not encode yield result. + return ManglingError::Success; +} + +ManglingError Remangler::mangleCoroutine(Node *node, unsigned depth) { + // The old mangler does not encode coroutines. + return ManglingError::Success; +} + ManglingError Remangler::mangleImplConvention(Node *node, unsigned depth) { DEMANGLER_ASSERT(node->getKind() == Node::Kind::ImplConvention, node); StringRef text = node->getText(); diff --git a/lib/Demangling/Remangler.cpp b/lib/Demangling/Remangler.cpp index 902bbd1dd8fa7..2bb13173e36e6 100644 --- a/lib/Demangling/Remangler.cpp +++ b/lib/Demangling/Remangler.cpp @@ -840,6 +840,14 @@ ManglingError Remangler::mangleNoEscapeFunctionType(Node *node, return ManglingError::Success; } +ManglingError Remangler::mangleCoroutine(Node *node, + unsigned depth) { + RETURN_IF_ERROR( + mangleChildNodesReversed(node, depth + 1)); // argument tuple, result type + Buffer << "Xy"; + return ManglingError::Success; +} + ManglingError Remangler::mangleBoundGenericClass(Node *node, unsigned depth) { return mangleAnyNominalType(node, depth + 1); } @@ -2339,6 +2347,12 @@ ManglingError Remangler::mangleNoDerivative(Node *node, unsigned depth) { return ManglingError::Success; } +ManglingError Remangler::mangleYieldResult(Node *node, unsigned depth) { + RETURN_IF_ERROR(mangleSingleChildNode(node, depth + 1)); + Buffer << "Yy"; + return ManglingError::Success; +} + ManglingError Remangler::mangleInfixOperator(Node *node, unsigned depth) { mangleIdentifierImpl(node, /*isOperator*/ true); Buffer << "oi"; diff --git a/lib/IRGen/Fulfillment.cpp b/lib/IRGen/Fulfillment.cpp index 13cce27cc03a8..9696d5bed1e48 100644 --- a/lib/IRGen/Fulfillment.cpp +++ b/lib/IRGen/Fulfillment.cpp @@ -57,6 +57,7 @@ static bool isLeafTypeMetadata(CanType type) { case TypeKind::PackExpansion: case TypeKind::PackElement: case TypeKind::BuiltinTuple: + case TypeKind::YieldResult: llvm_unreachable("these types do not have metadata"); // All the builtin types are leaves. diff --git a/lib/IRGen/GenType.cpp b/lib/IRGen/GenType.cpp index 51767c715660e..146bc846f5e9e 100644 --- a/lib/IRGen/GenType.cpp +++ b/lib/IRGen/GenType.cpp @@ -2340,6 +2340,8 @@ const TypeInfo *TypeConverter::convertType(CanType ty) { return convertInOutType(cast(ty)); case TypeKind::Tuple: return convertTupleType(cast(ty)); + case TypeKind::YieldResult: + llvm_unreachable("AST YieldResultType should be lowered by SILGen"); case TypeKind::Function: case TypeKind::GenericFunction: llvm_unreachable("AST FunctionTypes should be lowered by SILGen"); diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 95f4d84d3cbc9..4b8bdacef6254 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -2354,6 +2354,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { case TypeKind::BuiltinNonDefaultDistributedActorStorage: case TypeKind::SILMoveOnlyWrapped: case TypeKind::Integer: + case TypeKind::YieldResult: LLVM_DEBUG(llvm::dbgs() << "Unhandled type: "; DbgTy.getType()->dump(llvm::dbgs()); llvm::dbgs() << "\n"); MangledName = ""; diff --git a/lib/IRGen/MetadataRequest.cpp b/lib/IRGen/MetadataRequest.cpp index 92c10012361c4..a26303bc37b3e 100644 --- a/lib/IRGen/MetadataRequest.cpp +++ b/lib/IRGen/MetadataRequest.cpp @@ -2217,6 +2217,10 @@ namespace { DynamicMetadataRequest request) { llvm_unreachable("error type should not appear in IRGen"); } + MetadataResponse visitYieldResultType(CanYieldResultType type, + DynamicMetadataRequest request) { + llvm_unreachable("yields should have been lowered by SILGen"); + } MetadataResponse visitIntegerType(CanIntegerType type, DynamicMetadataRequest request) { diff --git a/lib/SIL/IR/AbstractionPattern.cpp b/lib/SIL/IR/AbstractionPattern.cpp index 61b9309e2ce39..3850b49bdd557 100644 --- a/lib/SIL/IR/AbstractionPattern.cpp +++ b/lib/SIL/IR/AbstractionPattern.cpp @@ -1173,11 +1173,15 @@ AbstractionPattern::getCXXMethodSelfPattern(CanType selfType) const { getGenericSignatureForFunctionComponent(), selfType); } -static CanType getResultType(CanType type) { - return cast(type).getResult(); +static CanType getResultType(CanType type, bool withoutYields) { + auto aft = cast(type); + if (withoutYields) + aft = CanAnyFunctionType(aft->getWithoutYields()); + + return aft.getResult(); } -AbstractionPattern AbstractionPattern::getFunctionResultType() const { +AbstractionPattern AbstractionPattern::getFunctionResultType(bool withoutYields) const { switch (getKind()) { case Kind::Invalid: llvm_unreachable("querying invalid abstraction pattern!"); @@ -1191,7 +1195,7 @@ AbstractionPattern AbstractionPattern::getFunctionResultType() const { return AbstractionPattern::getOpaque(); return AbstractionPattern(getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType())); + getResultType(getType(), withoutYields)); case Kind::Discard: llvm_unreachable("don't need to discard function abstractions yet"); case Kind::ClangType: @@ -1200,33 +1204,34 @@ AbstractionPattern AbstractionPattern::getFunctionResultType() const { auto clangFunctionType = getClangFunctionType(getClangType()); return AbstractionPattern(getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), + getResultType(getType(), withoutYields), clangFunctionType->getReturnType().getTypePtr()); } case Kind::CXXMethodType: case Kind::PartialCurriedCXXMethodType: return AbstractionPattern(getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), + getResultType(getType(), withoutYields), getCXXMethod()->getReturnType().getTypePtr()); case Kind::CurriedObjCMethodType: return getPartialCurriedObjCMethod( getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), + getResultType(getType(), withoutYields), getObjCMethod(), getEncodedForeignInfo()); case Kind::CurriedCFunctionAsMethodType: return getPartialCurriedCFunctionAsMethod( getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), + getResultType(getType(), withoutYields), getClangType(), getImportAsMemberStatus()); case Kind::CurriedCXXMethodType: return getPartialCurriedCXXMethod(getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), getCXXMethod(), + getResultType(getType(), withoutYields), + getCXXMethod(), getImportAsMemberStatus()); case Kind::PartialCurriedObjCMethodType: case Kind::ObjCMethodType: { @@ -1283,7 +1288,8 @@ AbstractionPattern AbstractionPattern::getFunctionResultType() const { return AbstractionPattern(getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), clangResultType); + getResultType(getType(), withoutYields), + clangResultType); } default: @@ -1293,14 +1299,15 @@ AbstractionPattern AbstractionPattern::getFunctionResultType() const { return AbstractionPattern::getObjCCompletionHandlerArgumentsType( getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), callbackParamTy, + getResultType(getType(), withoutYields), + callbackParamTy, getEncodedForeignInfo()); } } return AbstractionPattern(getGenericSubstitutions(), getGenericSignatureForFunctionComponent(), - getResultType(getType()), + getResultType(getType(), withoutYields), getObjCMethod()->getReturnType().getTypePtr()); } case Kind::OpaqueFunction: @@ -2922,10 +2929,9 @@ class SubstFunctionTypePatternVisitor addParam(param.getOrigFlags(), expansionType); } }); - - if (yieldType) { + + if (yieldType) substYieldType = visit(yieldType, yieldPattern); - } CanType newErrorType; @@ -2935,8 +2941,8 @@ class SubstFunctionTypePatternVisitor newErrorType = visit(errorType, errorPattern); } - auto newResultTy = visit(func.getResult(), - pattern.getFunctionResultType()); + auto newResultTy = visit(func->getWithoutYields()->getResult()->getCanonicalType(), + pattern.getFunctionResultType(/* withoutYields */ true)); std::optional extInfo; if (func->hasExtInfo()) @@ -2948,6 +2954,10 @@ class SubstFunctionTypePatternVisitor extInfo = extInfo->withThrows(true, newErrorType); } + // Yields were substituted separately + if (extInfo) + extInfo = extInfo->withCoroutine(false); + return CanFunctionType::get(FunctionType::CanParamArrayRef(newParams), newResultTy, extInfo); } diff --git a/lib/SIL/IR/SILFunctionType.cpp b/lib/SIL/IR/SILFunctionType.cpp index 7bf39297ee23e..a4827b1e77a48 100644 --- a/lib/SIL/IR/SILFunctionType.cpp +++ b/lib/SIL/IR/SILFunctionType.cpp @@ -1458,6 +1458,10 @@ class DestructureResults { return; } + // Skip yields, they should've already processed elsewhere + if (isa(substType)) + return; + auto &substResultTLForConvention = TC.getTypeLowering( origType, substType, TypeExpansionContext::minimal()); auto &substResultTL = TC.getTypeLowering(origType, substType, @@ -5049,6 +5053,8 @@ TypeConverter::getLoweredFormalTypes(SILDeclRef constant, extInfo = extInfo.withThrows(true, innerExtInfo.getThrownError()); if (innerExtInfo.isAsync()) extInfo = extInfo.withAsync(true); + if (innerExtInfo.isCoroutine()) + extInfo = extInfo.withCoroutine(true); // Distributed thunks are always `async throws` if (constant.isDistributedThunk()) { diff --git a/lib/SIL/IR/TypeLowering.cpp b/lib/SIL/IR/TypeLowering.cpp index 7d14993c50af5..c38078fe6ad20 100644 --- a/lib/SIL/IR/TypeLowering.cpp +++ b/lib/SIL/IR/TypeLowering.cpp @@ -606,6 +606,11 @@ namespace { IsTypeExpansionSensitive_t) { llvm_unreachable("shouldn't get an inout type here"); } + RetTy visitYieldResultType(CanYieldResultType type, + AbstractionPattern origType, + IsTypeExpansionSensitive_t) { + llvm_unreachable("shouldn't get an yield here"); + } RetTy visitErrorType(CanErrorType type, AbstractionPattern origType, IsTypeExpansionSensitive_t isSensitive) { @@ -4134,6 +4139,7 @@ getAnyFunctionRefInterfaceType(TypeConverter &TC, .withIsolation(funcType->getIsolation()) .withLifetimeDependencies(funcType->getLifetimeDependencies()) .withSendingResult(funcType->hasSendingResult()) + .withCoroutine(funcType->isCoroutine()) .build(); return CanAnyFunctionType::get( diff --git a/lib/SILGen/SILGenFunction.cpp b/lib/SILGen/SILGenFunction.cpp index d58bd97f34c46..94191a63c430c 100644 --- a/lib/SILGen/SILGenFunction.cpp +++ b/lib/SILGen/SILGenFunction.cpp @@ -1125,7 +1125,7 @@ void SILGenFunction::emitFunction(FuncDecl *fd) { auto captureInfo = SGM.M.Types.getLoweredLocalCaptures(SILDeclRef(fd)); emitProlog(fd, captureInfo, fd->getParameters(), fd->getImplicitSelfDecl(), - fd->getResultInterfaceType(), fd->getEffectiveThrownErrorType(), + fd->getResultInterfaceTypeWithoutYields(), fd->getEffectiveThrownErrorType(), fd->getThrowsLoc()); if (fd->isDistributedActorFactory()) { @@ -1133,7 +1133,7 @@ void SILGenFunction::emitFunction(FuncDecl *fd) { emitDistributedActorFactory(fd); } else { prepareEpilog(fd, - fd->getResultInterfaceType(), + fd->getResultInterfaceTypeWithoutYields(), fd->getEffectiveThrownErrorType(), CleanupLocation(fd)); diff --git a/lib/SILGen/SILGenPoly.cpp b/lib/SILGen/SILGenPoly.cpp index 7fe0b80798676..a6277a5f933ed 100644 --- a/lib/SILGen/SILGenPoly.cpp +++ b/lib/SILGen/SILGenPoly.cpp @@ -5817,6 +5817,9 @@ static ManagedValue createThunk(SILGenFunction &SGF, assert(expectedType->getLanguage() == fn.getType().castTo()->getLanguage() && "bridging in re-abstraction thunk?"); + // We cannot reabstract coroutines (yet) + assert(!expectedType->isCoroutine() && !sourceType->isCoroutine() && + "cannot reabstract a coroutine"); // Declare the thunk. SubstitutionMap interfaceSubs; diff --git a/lib/SILGen/SILGenProlog.cpp b/lib/SILGen/SILGenProlog.cpp index da0ea8e7ffad1..ff4bb6e76e726 100644 --- a/lib/SILGen/SILGenProlog.cpp +++ b/lib/SILGen/SILGenProlog.cpp @@ -1578,6 +1578,10 @@ static void emitIndirectResultParameters(SILGenFunction &SGF, assert(!resultType->is()); + // Skip yields, they are emitted elsewhere + if (resultType->is()) + return; + // If the return type is address-only, emit the indirect return argument. // The calling convention always uses minimal resilience expansion. diff --git a/lib/Sema/CSApply.cpp b/lib/Sema/CSApply.cpp index b0cd62eefe1f0..046cf59df57b1 100644 --- a/lib/Sema/CSApply.cpp +++ b/lib/Sema/CSApply.cpp @@ -7870,6 +7870,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType, #define TYPE(Name, Parent) #include "swift/AST/TypeNodes.def" case TypeKind::Error: + case TypeKind::YieldResult: case TypeKind::Module: case TypeKind::Enum: case TypeKind::Struct: @@ -7958,6 +7959,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType, case TypeKind::GenericFunction: case TypeKind::LValue: case TypeKind::InOut: + case TypeKind::YieldResult: case TypeKind::Pack: case TypeKind::PackExpansion: case TypeKind::PackElement: diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp index fa0c5405d83d6..66f07eb5021b3 100644 --- a/lib/Sema/CSSimplify.cpp +++ b/lib/Sema/CSSimplify.cpp @@ -7493,6 +7493,24 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind, return result; } + + case TypeKind::YieldResult: { + if (kind != ConstraintKind::Bind && kind != ConstraintKind::Subtype) + return getTypeMatchFailure(locator); + + auto *yield1 = cast(desugar1); + auto *yield2 = cast(desugar2); + + // TODO: In theory we can convert inout yield to non-inout one, + // however, we disallow this for now as overall generic coroutine + // semantics is a bit vague. + if (yield1->isInOut() != yield2->isInOut()) + return getTypeMatchFailure(locator); + + return matchTypes(yield1->getResultType(), yield2->getResultType(), + ConstraintKind::Bind, subflags, + locator.withPathElement(ConstraintLocator::LValueConversion)); + } case TypeKind::Placeholder: { // If it's allowed to attempt fixes, let's delegate @@ -8602,6 +8620,7 @@ ConstraintSystem::simplifyConstructionConstraint( case TypeKind::Function: case TypeKind::LValue: case TypeKind::InOut: + case TypeKind::YieldResult: case TypeKind::Module: case TypeKind::Pack: case TypeKind::PackExpansion: diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index aeb7098690963..1e2b3bf12f8d7 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -483,6 +483,7 @@ class AttributeChecker : public AttributeVisitor { void visitAddressableForDependenciesAttr(AddressableForDependenciesAttr *attr); void visitUnsafeAttr(UnsafeAttr *attr); void visitUnsafeSelfDependentResultAttr(UnsafeSelfDependentResultAttr *attr); + void visitCoroutineAttr(CoroutineAttr *attr); }; } // end anonymous namespace @@ -2658,6 +2659,10 @@ void AttributeChecker::visitSILGenNameAttr(SILGenNameAttr *A) { } } +void AttributeChecker::visitCoroutineAttr(CoroutineAttr *attr) { + // FIXME: allow only on @differentiable for modify accessorts +} + void AttributeChecker::visitUsedAttr(UsedAttr *attr) { if (D->getDeclContext()->isLocalContext()) diagnose(attr->getLocation(), diag::attr_only_at_non_local_scope, attr); diff --git a/lib/Sema/TypeCheckDecl.cpp b/lib/Sema/TypeCheckDecl.cpp index caa3bf87a9b8b..593d00b875e84 100644 --- a/lib/Sema/TypeCheckDecl.cpp +++ b/lib/Sema/TypeCheckDecl.cpp @@ -2043,7 +2043,8 @@ ResultTypeRequest::evaluate(Evaluator &evaluator, ValueDecl *decl) const { if (auto *accessor = dyn_cast(decl)) { auto *storage = accessor->getStorage(); - switch (accessor->getAccessorKind()) { + auto kind = accessor->getAccessorKind(); + switch (kind) { // For getters, set the result type to the value type. case AccessorKind::Get: case AccessorKind::DistributedGet: @@ -2066,13 +2067,13 @@ ResultTypeRequest::evaluate(Evaluator &evaluator, ValueDecl *decl) const { case AccessorKind::MutableAddress: return buildAddressorResultType(accessor, storage->getValueInterfaceType()); - // Coroutine accessors don't mention the value type directly. - // If we add yield types to the function type, we'll need to update this. + // Coroutine accessors yield storage value types case AccessorKind::Read: case AccessorKind::Read2: case AccessorKind::Modify: case AccessorKind::Modify2: - return TupleType::getEmpty(ctx); + return YieldResultType::get(storage->getValueInterfaceType(), + isYieldingMutableAccessor(kind)); } } @@ -2118,6 +2119,9 @@ ResultTypeRequest::evaluate(Evaluator &evaluator, ValueDecl *decl) const { TypeResolutionOptions(TypeResolverContext::FunctionResult); if (decl->preconcurrency()) options |= TypeResolutionFlags::Preconcurrency; + if (const auto *const funcDecl = dyn_cast(decl)) + if (funcDecl->isCoroutine()) + options |= TypeResolutionFlags::Coroutine; auto *const dc = decl->getInnermostDeclContext(); return TypeResolution::forInterface(dc, options, @@ -2558,6 +2562,7 @@ InterfaceTypeRequest::evaluate(Evaluator &eval, ValueDecl *D) const { infoBuilder = infoBuilder.withNoEscape(fd->isDeferBody()); if (fd->hasSendingResult()) infoBuilder = infoBuilder.withSendingResult(); + infoBuilder = infoBuilder.withCoroutine(fd->isCoroutine()); } // Lifetime dependencies only apply to the outer function type. diff --git a/lib/Sema/TypeCheckDeclOverride.cpp b/lib/Sema/TypeCheckDeclOverride.cpp index 5861b1b0dfbfa..cc683ff2cbe9b 100644 --- a/lib/Sema/TypeCheckDeclOverride.cpp +++ b/lib/Sema/TypeCheckDeclOverride.cpp @@ -1595,6 +1595,7 @@ namespace { UNINTERESTING_ATTR(CDecl) UNINTERESTING_ATTR(Concurrent) UNINTERESTING_ATTR(Consuming) + UNINTERESTING_ATTR(Coroutine) UNINTERESTING_ATTR(Documentation) UNINTERESTING_ATTR(Dynamic) UNINTERESTING_ATTR(DynamicCallable) diff --git a/lib/Sema/TypeCheckGeneric.cpp b/lib/Sema/TypeCheckGeneric.cpp index 2a51bb2253380..e4b5b3608be6e 100644 --- a/lib/Sema/TypeCheckGeneric.cpp +++ b/lib/Sema/TypeCheckGeneric.cpp @@ -928,8 +928,12 @@ GenericSignatureRequest::evaluate(Evaluator &evaluator, } }(); if (resultTypeRepr && !resultTypeRepr->hasOpaque()) { + bool isCoroutine = func ? func->isCoroutine() : false; + TypeResolutionOptions resultOptions(TypeResolverContext::FunctionResult); + if (isCoroutine) + resultOptions |= TypeResolutionFlags::Coroutine; const auto resultType = - resolution.withOptions(TypeResolverContext::FunctionResult) + resolution.withOptions(resultOptions) .resolveType(resultTypeRepr); inferenceSources.push_back(resultType.getPointer()); diff --git a/lib/Sema/TypeCheckStmt.cpp b/lib/Sema/TypeCheckStmt.cpp index 6f1acdeb1f767..65c9062191655 100644 --- a/lib/Sema/TypeCheckStmt.cpp +++ b/lib/Sema/TypeCheckStmt.cpp @@ -1156,8 +1156,14 @@ class StmtChecker : public StmtVisitor { SmallVector buffer; auto TheFunc = AnyFunctionRef::fromDeclContext(DC); - auto yieldResults = TheFunc->getBodyYieldResults(buffer); + // Checking yields requires proper interface type. If decl is invalid, then + // we already emitted diagnostics elsewhere. + if (auto *AFD = TheFunc->getAbstractFunctionDecl()) { + if (AFD->isInvalid()) + return YS; + } + auto yieldResults = TheFunc->getBodyYieldResults(buffer); auto yieldExprs = YS->getMutableYields(); if (yieldExprs.size() != yieldResults.size()) { getASTContext().Diags.diagnose(YS->getYieldLoc(), diag::bad_yield_count, diff --git a/lib/Sema/TypeCheckStorage.cpp b/lib/Sema/TypeCheckStorage.cpp index af255d6792e30..6bca5fa4ee0d1 100644 --- a/lib/Sema/TypeCheckStorage.cpp +++ b/lib/Sema/TypeCheckStorage.cpp @@ -2537,8 +2537,9 @@ createCoroutineAccessorPrototype(AbstractStorageDecl *storage, // The forwarding index parameters. auto *params = buildIndexForwardingParamList(storage, {}, ctx); - // Coroutine accessors always return (). - const Type retTy = TupleType::getEmpty(ctx); + // Coroutine accessors yields storage value types + const Type retTy = YieldResultType::get(storage->getValueInterfaceType(), + isYieldingMutableAccessor(kind)); auto *accessor = AccessorDecl::create( ctx, loc, /*AccessorKeywordLoc=*/SourceLoc(), kind, storage, diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index a52f93ad6cc86..cfee97e6de90f 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -3750,6 +3750,17 @@ TypeResolver::resolveAttributedType(TypeRepr *repr, TypeResolutionOptions option (void)claim(attrs); // TODO: add proper validation + if (auto yield = claim(attrs)) { + (void)yield; + // FIXME: What additional checks should we do here? + // FIXME: Turn into diagnostics + assert(options.contains(TypeResolutionFlags::Coroutine)); + // SIL yields are represented directly, no need to wrap them into special type + if (!options.contains(TypeResolutionFlags::SILType)) + ty = YieldResultType::get(ty, + options.is(TypeResolverContext::InoutFunctionInput)); + } + // There are a bunch of attributes in SIL that are essentially new // type constructors. Some of these are allowed even in AST positions; // other are only allowed in lowered types. @@ -4248,6 +4259,7 @@ NeverNullType TypeResolver::resolveASTFunctionType( } bool sendable = claim(attrs); + bool coroutine = claim(attrs); auto isolation = FunctionTypeIsolation::forNonIsolated(); @@ -4438,6 +4450,8 @@ NeverNullType TypeResolver::resolveASTFunctionType( auto resultOptions = options.withoutContext(); resultOptions.setContext(TypeResolverContext::FunctionResult); + if (coroutine) + resultOptions |= TypeResolutionFlags::Coroutine; auto outputTy = resolveType(repr->getResultTypeRepr(), resultOptions); if (outputTy->hasError()) { return ErrorType::get(ctx); @@ -4500,6 +4514,7 @@ NeverNullType TypeResolver::resolveASTFunctionType( .withSendable(sendable) .withAsync(repr->isAsync()) .withClangFunctionType(clangFnType) + .withCoroutine(coroutine) .build(); // SIL uses polymorphic function types to resolve overloaded member functions. @@ -4610,6 +4625,7 @@ NeverNullType TypeResolver::resolveSILFunctionType(FunctionTypeRepr *repr, default: llvm_unreachable("bad TypeAttrKind for TAR_SILCoroutine"); } + options |= TypeResolutionFlags::Coroutine; } ParameterConvention callee = ParameterConvention::Direct_Unowned; @@ -5332,12 +5348,20 @@ NeverNullType TypeResolver::resolveOwnershipTypeRepr(OwnershipTypeRepr *repr, TypeResolutionOptions options) { auto ownershipRepr = dyn_cast(repr); - // ownership is only valid for (non-Subscript and non-EnumCaseDecl) - // function parameters. - if (!options.is(TypeResolverContext::FunctionInput) || - options.hasBase(TypeResolverContext::SubscriptDecl) || - options.hasBase(TypeResolverContext::EnumElementDecl)) { + // ownership is only valid for (non-Subscript and non-EnumCaseDecl) + // function parameters or coroutine results (yields) + bool isCoroutineInOutYield = + (options.hasBase(TypeResolverContext::FunctionResult) || // decls + options.is(TypeResolverContext::FunctionResult)) && // function types + options.contains(TypeResolutionFlags::Coroutine) && + (ownershipRepr && + ownershipRepr->getSpecifier() == ParamSpecifier::InOut); + + if (!(options.is(TypeResolverContext::FunctionInput) && + !options.hasBase(TypeResolverContext::SubscriptDecl) && + !options.hasBase(TypeResolverContext::EnumElementDecl)) && + !isCoroutineInOutYield) { decltype(diag::attr_only_on_parameters) diagID; if (options.hasBase(TypeResolverContext::SubscriptDecl) || options.hasBase(TypeResolverContext::EnumElementDecl)) { @@ -6018,6 +6042,7 @@ NeverNullType TypeResolver::resolveTupleType(TupleTypeRepr *repr, auto elementOptions = options; if (!repr->isParenType()) { + elementOptions = elementOptions.withBaseContext(options.getContext()); elementOptions = elementOptions.withoutContext(true); elementOptions = elementOptions.withContext(TypeResolverContext::TupleElement); } @@ -6043,6 +6068,7 @@ NeverNullType TypeResolver::resolveTupleType(TupleTypeRepr *repr, !moveOnlyElementIndex.has_value() && !ty->hasUnboundGenericType() && !ty->hasTypeVariable() && + !ty->is() && !isa(tyR)) { auto contextTy = GenericEnvironment::mapTypeIntoContext( resolution.getGenericSignature().getGenericEnvironment(), ty); diff --git a/lib/Sema/TypeCheckType.h b/lib/Sema/TypeCheckType.h index 0fbc0ebe615ae..9f88924f19934 100644 --- a/lib/Sema/TypeCheckType.h +++ b/lib/Sema/TypeCheckType.h @@ -87,6 +87,9 @@ enum class TypeResolutionFlags : uint16_t { /// Whether the immediate context has an @escaping attribute. DirectEscaping = 1 << 14, + + /// We are in @yield_once coroutine declaration + Coroutine = 1 << 15, }; /// Type resolution contexts that require special handling. @@ -556,6 +559,13 @@ class TypeResolutionOptions { copy.setContext(context); return copy; } + + inline + TypeResolutionOptions withBaseContext(TypeResolverContext context) const { + auto copy = *this; + copy.base = context; + return copy; + } }; /// A function reference used to "open" the given unbound generic type diff --git a/lib/Serialization/DeclTypeRecordNodes.def b/lib/Serialization/DeclTypeRecordNodes.def index 0ee58b5d3e668..15aabb8b457fc 100644 --- a/lib/Serialization/DeclTypeRecordNodes.def +++ b/lib/Serialization/DeclTypeRecordNodes.def @@ -124,6 +124,8 @@ TYPE(INTEGER) TYPE(BUILTIN_FIXED_ARRAY) +TYPE(YIELDS) + FIRST_DECL(TYPE_ALIAS, 50) DECL(GENERIC_TYPE_PARAM) DECL(ASSOCIATED_TYPE) diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index a0ceef1c73f36..29d3af0abc063 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -7362,6 +7362,20 @@ Expected DESERIALIZE_TYPE(NOMINAL_TYPE)( return NominalType::get(nominal, parentTy.get(), MF.getContext()); } +Expected DESERIALIZE_TYPE(YIELDS_TYPE)(ModuleFile &MF, + SmallVectorImpl &scratch, + StringRef blobData) { + TypeID yieldResultTyID; + bool isIonOut = false; + decls_block::YieldResultTypeLayout::readRecord(scratch, yieldResultTyID, isIonOut); + + auto yieldResultTy = MF.getTypeChecked(yieldResultTyID); + if (!yieldResultTy) + return yieldResultTy.takeError(); + + return YieldResultType::get(yieldResultTy.get(), isIonOut); +} + Expected DESERIALIZE_TYPE(TUPLE_TYPE)(ModuleFile &MF, SmallVectorImpl &scratch, StringRef blobData) { @@ -7399,7 +7413,7 @@ detail::function_deserializer::deserialize(ModuleFile &MF, StringRef blobData, bool isGeneric) { TypeID resultID; uint8_t rawRepresentation, rawDiffKind; - bool noescape = false, sendable, async, throws, hasSendingResult; + bool noescape = false, sendable, async, throws, hasSendingResult, coro; TypeID thrownErrorID; GenericSignature genericSig; TypeID clangTypeID; @@ -7409,12 +7423,12 @@ detail::function_deserializer::deserialize(ModuleFile &MF, decls_block::FunctionTypeLayout::readRecord( scratch, resultID, rawRepresentation, clangTypeID, noescape, sendable, async, throws, thrownErrorID, rawDiffKind, rawIsolation, - hasSendingResult); + hasSendingResult, coro); } else { GenericSignatureID rawGenericSig; decls_block::GenericFunctionTypeLayout::readRecord( scratch, resultID, rawRepresentation, sendable, async, throws, - thrownErrorID, rawDiffKind, rawIsolation, hasSendingResult, + thrownErrorID, rawDiffKind, rawIsolation, hasSendingResult, coro, rawGenericSig); genericSig = MF.getGenericSignature(rawGenericSig); clangTypeID = 0; @@ -7470,6 +7484,7 @@ detail::function_deserializer::deserialize(ModuleFile &MF, /*LifetimeDependenceInfo */ {}, hasSendingResult) .withSendable(sendable) .withAsync(async) + .withCoroutine(coro) .build(); auto resultTy = MF.getTypeChecked(resultID); diff --git a/lib/Serialization/ModuleFormat.h b/lib/Serialization/ModuleFormat.h index 2e10089b6b0c3..50c670e833190 100644 --- a/lib/Serialization/ModuleFormat.h +++ b/lib/Serialization/ModuleFormat.h @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0; /// describe what change you made. The content of this comment isn't important; /// it just ensures a conflict if two people change the module format. /// Don't worry about adhering to the 80-column limit for this line. -const uint16_t SWIFTMODULE_VERSION_MINOR = 972; // SIL asmname string table +const uint16_t SWIFTMODULE_VERSION_MINOR = 973; // coro AST /// A standard hash seed used for all string hashes in a serialized module. /// @@ -1351,6 +1351,12 @@ namespace decls_block { TypeIDField // type >; + TYPE_LAYOUT(YieldResultTypeLayout, + YIELDS_TYPE, + TypeIDField, // inner type + BCFixed<1> // inout? + ); + TYPE_LAYOUT(FunctionTypeLayout, FUNCTION_TYPE, TypeIDField, // output @@ -1363,7 +1369,8 @@ namespace decls_block { TypeIDField, // thrown error DifferentiabilityKindField, // differentiability kind FunctionTypeIsolationField, // isolation - BCFixed<1> // has sending result + BCFixed<1>, // has sending result + BCFixed<1> // coroutine? // trailed by parameters // Optionally lifetime dependence info ); @@ -1465,6 +1472,7 @@ namespace decls_block { DifferentiabilityKindField, // differentiability kind FunctionTypeIsolationField, // isolation BCFixed<1>, // has sending result + BCFixed<1>, // coroutine? GenericSignatureIDField // generic signature // trailed by parameters diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index d520e7602e6a4..6307def5256e0 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -5698,6 +5698,15 @@ class Serializer::TypeSerializer : public TypeVisitor { visitBuiltinTypeImpl(ty); } + void visitYieldResultType(const YieldResultType *ty) { + using namespace decls_block; + unsigned abbrCode = S.DeclTypeAbbrCodes[YieldResultTypeLayout::Code]; + + YieldResultTypeLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode, + S.addTypeRef(ty->getResultType()), + ty->isInOut()); + } + void visitTypeAliasType(const TypeAliasType *alias) { using namespace decls_block; @@ -5987,7 +5996,8 @@ class Serializer::TypeSerializer : public TypeVisitor { S.addTypeRef(fnTy->getThrownError()), getRawStableDifferentiabilityKind(fnTy->getDifferentiabilityKind()), isolation, - fnTy->hasSendingResult()); + fnTy->hasSendingResult(), + fnTy->isCoroutine()); serializeFunctionTypeParams(fnTy); @@ -6009,7 +6019,7 @@ class Serializer::TypeSerializer : public TypeVisitor { fnTy->isSendable(), fnTy->isAsync(), fnTy->isThrowing(), S.addTypeRef(fnTy->getThrownError()), getRawStableDifferentiabilityKind(fnTy->getDifferentiabilityKind()), - isolation, fnTy->hasSendingResult(), + isolation, fnTy->hasSendingResult(), fnTy->isCoroutine(), S.addGenericSignatureRef(genericSig)); serializeFunctionTypeParams(fnTy); @@ -6447,6 +6457,8 @@ void Serializer::writeAllDeclsAndTypes() { registerDeclTypeAbbr(); + registerDeclTypeAbbr(); + registerDeclTypeAbbr(); registerDeclTypeAbbr(); registerDeclTypeAbbr(); diff --git a/test/AutoDiff/SILGen/witness_table.swift b/test/AutoDiff/SILGen/witness_table.swift index 4f631f4067dc2..6874a370af9b0 100644 --- a/test/AutoDiff/SILGen/witness_table.swift +++ b/test/AutoDiff/SILGen/witness_table.swift @@ -116,12 +116,12 @@ struct Struct: Protocol { // CHECK-NEXT: method #Protocol.property!setter: (inout Self) -> (Float) -> () : @$s13witness_table6StructVAA8ProtocolA2aDP8propertySfvsTW // CHECK-NEXT: method #Protocol.property!setter.jvp.SS.: (inout Self) -> (Float) -> () : @AD__$s13witness_table6StructVAA8ProtocolA2aDP8propertySfvsTW_jvp_SS // CHECK-NEXT: method #Protocol.property!setter.vjp.SS.: (inout Self) -> (Float) -> () : @AD__$s13witness_table6StructVAA8ProtocolA2aDP8propertySfvsTW_vjp_SS -// CHECK-NEXT: method #Protocol.property!modify: (inout Self) -> () -> () : @$s13witness_table6StructVAA8ProtocolA2aDP8propertySfvMTW +// CHECK-NEXT: method #Protocol.property!modify: (inout Self) -> @yield_once () -> inout @yields Float : @$s13witness_table6StructVAA8ProtocolA2aDP8propertySfvMTW // CHECK-NEXT: method #Protocol.subscript!getter: (Self) -> (Float, Float) -> Float : @$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcigTW // CHECK-NEXT: method #Protocol.subscript!getter.jvp.SUS.: (Self) -> (Float, Float) -> Float : @AD__$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcigTW_jvp_SUS // CHECK-NEXT: method #Protocol.subscript!getter.vjp.SUS.: (Self) -> (Float, Float) -> Float : @AD__$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcigTW_vjp_SUS // CHECK-NEXT: method #Protocol.subscript!setter: (inout Self) -> (Float, Float, Float) -> () : @$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcisTW // CHECK-NEXT: method #Protocol.subscript!setter.jvp.USUS.: (inout Self) -> (Float, Float, Float) -> () : @AD__$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcisTW_jvp_USUS // CHECK-NEXT: method #Protocol.subscript!setter.vjp.USUS.: (inout Self) -> (Float, Float, Float) -> () : @AD__$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftcisTW_vjp_USUS -// CHECK-NEXT: method #Protocol.subscript!modify: (inout Self) -> (Float, Float) -> () : @$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftciMTW +// CHECK-NEXT: method #Protocol.subscript!modify: (inout Self) -> @yield_once (Float, Float) -> inout @yields Float : @$s13witness_table6StructVAA8ProtocolA2aDPyS2f_SftciMTW // CHECK: } diff --git a/test/AutoDiff/SILOptimizer/activity_analysis.swift b/test/AutoDiff/SILOptimizer/activity_analysis.swift index e7bd67f8d9456..030b7975f37d8 100644 --- a/test/AutoDiff/SILOptimizer/activity_analysis.swift +++ b/test/AutoDiff/SILOptimizer/activity_analysis.swift @@ -765,7 +765,7 @@ func testClassModifyAccessor(_ c: inout C) { // CHECK: [VARIED] %7 = load [copy] %6 : $*C // CHECK: [VARIED] %9 = class_method %7 : $C, #C.float!getter : (C) -> () -> Float, $@convention(method) (@guaranteed C) -> Float // CHECK: [VARIED] %10 = apply %9(%7) : $@convention(method) (@guaranteed C) -> Float -// CHECK: [VARIED] %12 = class_method %4 : $C, #C.float!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Float +// CHECK: [VARIED] %12 = class_method %4 : $C, #C.float!modify : (C) -> @yield_once () -> inout @yields Float, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Float // CHECK: [VARIED] (**%13**, %14) = begin_apply %12(%4) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Float // CHECK: [VARIED] (%13, **%14**) = begin_apply %12(%4) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Float // CHECK: [NONE] // function_ref static Float.*= infix(_:_:) diff --git a/test/IRGen/default_override.sil b/test/IRGen/default_override.sil index 88c4fe6e4cb00..e889defb92578 100644 --- a/test/IRGen/default_override.sil +++ b/test/IRGen/default_override.sil @@ -28,19 +28,19 @@ sil @B_i_modify : $@yield_once @convention(method) (@guaranteed B) -> @yields @i sil @B_i_modify2 : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int sil_vtable B { - #B.i!read: (B) -> () -> () : @B_i_read - #B.i!read2: (B) -> () -> () : @B_i_read2 + #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read + #B.i!read2: (B) -> @yield_once () -> @yields Int : @B_i_read2 #B.i!setter: (B) -> (Int) -> () : @B_i_set - #B.i!modify: (B) -> () -> () : @B_i_modify - #B.i!modify2: (B) -> () -> () : @B_i_modify2 + #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify + #B.i!modify2: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2 } sil @B_i_read2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields Int sil @B_i_modify2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int sil_default_override_table B { - #B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override - #B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override + #B.i!read2: #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read2_default_override + #B.i!modify2: #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2_default_override } // CHECK: %swift.method_default_override_descriptor = type { i32, i32, i32 } diff --git a/test/Parse/coroutine_accessors_ambiguity.swift b/test/Parse/coroutine_accessors_ambiguity.swift index 90aa16252f904..e0e060912a9e9 100644 --- a/test/Parse/coroutine_accessors_ambiguity.swift +++ b/test/Parse/coroutine_accessors_ambiguity.swift @@ -17,7 +17,7 @@ func read(_ c : () -> T) -> T { c() } // disabled: ok! var im : Int { modify { // expected-enabled-error{{variable with a 'modify' accessor must also have a getter, addressor, or 'read' accessor}} - 1 // expected-enabled-warning{{integer literal is unused}} + 1 // expected-enabled-error{{unexpected non-void return value in void function}} } } @@ -25,6 +25,6 @@ var im : Int { // disabled: ok! var ir : Int { read { - 1 // expected-enabled-warning{{integer literal is unused}} + 1 // expected-enabled-error{{unexpected non-void return value in void function}} } } diff --git a/test/Parse/coroutines.swift b/test/Parse/coroutines.swift new file mode 100644 index 0000000000000..5e7eeedc40b4f --- /dev/null +++ b/test/Parse/coroutines.swift @@ -0,0 +1,41 @@ +// RUN: %target-typecheck-verify-swift + +@yield_once func coro(_ x : inout Float) -> inout @yields Float { + var _x = Float(0.0) + yield &_x + x = Float(_x) +} + +func retCoro() -> @yield_once (_ x : inout Float) -> inout @yields Float { + return coro +} + +@yield_once func coroWithResult(_ x : Float) -> (yield: inout @yields Float, result: Float) { + var _x = Float(0.0) + yield &_x + return _x +} + +func retCoroWithResult() -> @yield_once (_ x : Float) -> (inout @yields Float, Float) { + return coroWithResult +} + +@yield_once func coroGen(_ x : inout T) -> inout @yields T { + var _x = x + yield &_x + x = _x +} + +func retGenCoro() -> @yield_once (_ x : inout T) -> inout @yields T { + return coroGen +} + +@yield_once func coroGenWithResult(_ x : T) -> (yield: inout @yields T, result: T) { + var _x = x + yield &_x + return _x +} + +func retCoroGenWithResult() -> @yield_once (_ x : T) -> (inout @yields T, T) { + return coroGenWithResult +} diff --git a/test/SIL/Parser/default_override.sil b/test/SIL/Parser/default_override.sil index 19cc6b35bfd27..ac91e1baa41a9 100644 --- a/test/SIL/Parser/default_override.sil +++ b/test/SIL/Parser/default_override.sil @@ -24,21 +24,21 @@ sil @B_i_modify : $@yield_once @convention(method) (@guaranteed B) -> @yields @i sil @B_i_modify2 : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int sil_vtable B { - #B.i!read: (B) -> () -> () : @B_i_read - #B.i!read2: (B) -> () -> () : @B_i_read2 + #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read + #B.i!read2: (B) -> @yield_once () -> @yields Int : @B_i_read2 #B.i!setter: (B) -> (Int) -> () : @B_i_set - #B.i!modify: (B) -> () -> () : @B_i_modify - #B.i!modify2: (B) -> () -> () : @B_i_modify2 + #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify + #B.i!modify2: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2 } sil @B_i_read2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields Int sil @B_i_modify2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int // CHECK-LABEL: sil_default_override_table B { -// CHECK-NEXT: #B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override -// CHECK-NEXT: #B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override +// CHECK-NEXT: #B.i!read2: #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read2_default_override +// CHECK-NEXT: #B.i!modify2: #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2_default_override // CHECK-NEXT: } sil_default_override_table B { - #B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override - #B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override + #B.i!read2: #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read2_default_override + #B.i!modify2: #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2_default_override } diff --git a/test/SIL/Parser/overloaded_member.sil b/test/SIL/Parser/overloaded_member.sil index 151e02fe99abb..9cde855c03574 100644 --- a/test/SIL/Parser/overloaded_member.sil +++ b/test/SIL/Parser/overloaded_member.sil @@ -53,7 +53,7 @@ class B { sil [ossa] @test_overloaded_subscript : $@convention(thin) (@guaranteed B, B.Index) -> () { bb0(%0 : @guaranteed $B, %1 : $B.Index): - %reader = class_method %0 : $B, #B.subscript!read : (B) -> (B.Index) -> (), $@convention(method) @yield_once (B.Index, @guaranteed B) -> @yields @guaranteed B.Element + %reader = class_method %0 : $B, #B.subscript!read : (B) -> @yield_once (B.Index) -> @yields B.Element, $@convention(method) @yield_once (B.Index, @guaranteed B) -> @yields @guaranteed B.Element (%element, %token) = begin_apply %reader(%1, %0) : $@convention(method) @yield_once (B.Index, @guaranteed B) -> @yields @guaranteed B.Element end_apply %token as $() diff --git a/test/SIL/Serialization/default_override.sil b/test/SIL/Serialization/default_override.sil index 2ee938086a4cf..c0956d8c0ce77 100644 --- a/test/SIL/Serialization/default_override.sil +++ b/test/SIL/Serialization/default_override.sil @@ -26,21 +26,21 @@ sil @B_i_modify : $@yield_once @convention(method) (@guaranteed B) -> @yields @i sil @B_i_modify2 : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int sil_vtable B { - #B.i!read: (B) -> () -> () : @B_i_read - #B.i!read2: (B) -> () -> () : @B_i_read2 + #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read + #B.i!read2: (B) -> @yield_once () -> @yields Int : @B_i_read2 #B.i!setter: (B) -> (Int) -> () : @B_i_set - #B.i!modify: (B) -> () -> () : @B_i_modify - #B.i!modify2: (B) -> () -> () : @B_i_modify2 + #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify + #B.i!modify2: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2 } sil @B_i_read2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields Int sil @B_i_modify2_default_override : $@yield_once_2 @convention(method) (@guaranteed B) -> @yields @inout Int // CHECK-LABEL: sil_default_override_table B { -// CHECK-NEXT: #B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override -// CHECK-NEXT: #B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override +// CHECK-NEXT: #B.i!read2: #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read2_default_override +// CHECK-NEXT: #B.i!modify2: #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2_default_override // CHECK-NEXT: } sil_default_override_table B { - #B.i!read2: #B.i!read: (B) -> () -> () : @B_i_read2_default_override - #B.i!modify2: #B.i!modify: (B) -> () -> () : @B_i_modify2_default_override + #B.i!read2: #B.i!read: (B) -> @yield_once () -> @yields Int : @B_i_read2_default_override + #B.i!modify2: #B.i!modify: (B) -> @yield_once () -> inout @yields Int : @B_i_modify2_default_override } diff --git a/test/SIL/concurrentclosure_capture_verify_canonical_addressonly.sil b/test/SIL/concurrentclosure_capture_verify_canonical_addressonly.sil index d1233950cbeae..03321b40984cd 100644 --- a/test/SIL/concurrentclosure_capture_verify_canonical_addressonly.sil +++ b/test/SIL/concurrentclosure_capture_verify_canonical_addressonly.sil @@ -74,7 +74,7 @@ bb0(%0 : $*T): destroy_value %15 : $@Sendable @callee_guaranteed () -> () // id: %22 destroy_value %11 : $F // id: %23 %24 = begin_access [modify] [dynamic] %9 : $*T // users: %31, %26 - %25 = witness_method $T, #MyProt.k!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: MyProt) <τ_0_0 where τ_0_0 : MyProt> (@inout τ_0_0) -> @yields @inout FakeOptional // user: %26 + %25 = witness_method $T, #MyProt.k!modify : (inout Self) -> @yield_once () -> inout @yields FakeOptional : $@yield_once @convention(witness_method: MyProt) <τ_0_0 where τ_0_0 : MyProt> (@inout τ_0_0) -> @yields @inout FakeOptional // user: %26 (%26, %27) = begin_apply %25(%24) : $@yield_once @convention(witness_method: MyProt) <τ_0_0 where τ_0_0 : MyProt> (@inout τ_0_0) -> @yields @inout FakeOptional // users: %29, %30 // function_ref inoutUserOptKlass(_:) %28 = function_ref @$s37concurrentfunction_capturediagnostics17inoutUserOptKlassyyAA0F0CSgzF : $@convention(thin) (@inout FakeOptional) -> () // user: %29 diff --git a/test/SIL/concurrentclosure_capture_verify_raw.sil b/test/SIL/concurrentclosure_capture_verify_raw.sil index 7b5421f7309a7..8a524d4c76539 100644 --- a/test/SIL/concurrentclosure_capture_verify_raw.sil +++ b/test/SIL/concurrentclosure_capture_verify_raw.sil @@ -107,7 +107,7 @@ bb0(%0 : $*T): destroy_value %15 : $@Sendable @callee_guaranteed () -> () // id: %22 destroy_value %11 : $F // id: %23 %24 = begin_access [modify] [dynamic] %9 : $*T // users: %31, %26 - %25 = witness_method $T, #MyProt.k!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: MyProt) <τ_0_0 where τ_0_0 : MyProt> (@inout τ_0_0) -> @yields @inout FakeOptional // user: %26 + %25 = witness_method $T, #MyProt.k!modify : (inout Self) -> @yield_once () -> inout @yields FakeOptional : $@yield_once @convention(witness_method: MyProt) <τ_0_0 where τ_0_0 : MyProt> (@inout τ_0_0) -> @yields @inout FakeOptional // user: %26 (%26, %27) = begin_apply %25(%24) : $@yield_once @convention(witness_method: MyProt) <τ_0_0 where τ_0_0 : MyProt> (@inout τ_0_0) -> @yields @inout FakeOptional // users: %29, %30 // function_ref inoutUserOptKlass(_:) %28 = function_ref @$s37concurrentfunction_capturediagnostics17inoutUserOptKlassyyAA0F0CSgzF : $@convention(thin) (@inout FakeOptional) -> () // user: %29 diff --git a/test/SILGen/addressors.swift b/test/SILGen/addressors.swift index a9829aff4ee53..c3f76d966f851 100644 --- a/test/SILGen/addressors.swift +++ b/test/SILGen/addressors.swift @@ -343,10 +343,10 @@ struct Foo: FooProtocol { // CHECK-LABEL: sil_vtable Base { // CHECK-NEXT: #Base.data!getter: (Base) -> () -> UnsafeMutablePointer : @$s10addressors4BaseC4dataSpys5Int32VGvg // CHECK-NEXT: #Base.data!setter: (Base) -> (UnsafeMutablePointer) -> () : @$s10addressors4BaseC4dataSpys5Int32VGvs -// CHECK-NEXT: #Base.data!modify: (Base) -> () -> () : @$s10addressors4BaseC4dataSpys5Int32VGvM +// CHECK-NEXT: #Base.data!modify: (Base) -> @yield_once () -> inout @yields UnsafeMutablePointer : @$s10addressors4BaseC4dataSpys5Int32VGvM // CHECK-NEXT: #Base.value!getter: (Base) -> () -> Int32 : @$s10addressors4BaseC5values5Int32Vvg // CHECK-NEXT: #Base.value!setter: (Base) -> (Int32) -> () : @$s10addressors4BaseC5values5Int32Vvs -// CHECK-NEXT: #Base.value!modify: (Base) -> () -> () : @$s10addressors4BaseC5values5Int32VvM +// CHECK-NEXT: #Base.value!modify: (Base) -> @yield_once () -> inout @yields Int32 : @$s10addressors4BaseC5values5Int32VvM // CHECK-NEXT: #Base.init!allocator: (Base.Type) -> () -> Base : @$s10addressors4BaseCACycfC // CHECK-NEXT: #Base.deinit!deallocator: @$s10addressors4BaseCfD // CHECK-NEXT: } @@ -354,10 +354,10 @@ struct Foo: FooProtocol { // CHECK-LABEL: sil_vtable Sub { // CHECK-NEXT: #Base.data!getter: (Base) -> () -> UnsafeMutablePointer : @$s10addressors4BaseC4dataSpys5Int32VGvg // CHECK-NEXT: #Base.data!setter: (Base) -> (UnsafeMutablePointer) -> () : @$s10addressors4BaseC4dataSpys5Int32VGvs -// CHECK-NEXT: #Base.data!modify: (Base) -> () -> () : @$s10addressors4BaseC4dataSpys5Int32VGvM +// CHECK-NEXT: #Base.data!modify: (Base) -> @yield_once () -> inout @yields UnsafeMutablePointer : @$s10addressors4BaseC4dataSpys5Int32VGvM // CHECK-NEXT: #Base.value!getter: (Base) -> () -> Int32 : @$s10addressors3SubC5values5Int32Vvg // CHECK-NEXT: #Base.value!setter: (Base) -> (Int32) -> () : @$s10addressors3SubC5values5Int32Vvs -// CHECK-NEXT: #Base.value!modify: (Base) -> () -> () : @$s10addressors3SubC5values5Int32VvM +// CHECK-NEXT: #Base.value!modify: (Base) -> @yield_once () -> inout @yields Int32 : @$s10addressors3SubC5values5Int32VvM // CHECK-NEXT: #Base.init!allocator: (Base.Type) -> () -> Base : @$s10addressors3SubCACycfC // CHECK-NEXT: #Sub.deinit!deallocator: @$s10addressors3SubCfD // CHECK-NEXT: } diff --git a/test/SILGen/borrow_accessor_synthesis.swift b/test/SILGen/borrow_accessor_synthesis.swift index 77873de6ea7f3..803814d97e99b 100644 --- a/test/SILGen/borrow_accessor_synthesis.swift +++ b/test/SILGen/borrow_accessor_synthesis.swift @@ -112,21 +112,21 @@ func testP1(_ p: some P) { // CHECK: sil hidden [ossa] @$s25borrow_accessor_synthesis6testP2yyxzAA1PRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> () { // CHECK: bb0([[REG0:%.*]] : $*τ_0_0): // CHECK: [[REG2:%.*]] = begin_access [modify] [unknown] [[REG0]] -// CHECK: [[REG3:%.*]] = witness_method $τ_0_0, #P.prop1!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element +// CHECK: [[REG3:%.*]] = witness_method $τ_0_0, #P.prop1!modify : (inout Self) -> @yield_once () -> inout @yields Self.Element : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: ([[REG4]], [[REG5]]) = begin_apply [[REG3]]<τ_0_0>([[REG2]]) : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: [[REG6:%.*]] = function_ref @$s25borrow_accessor_synthesis6mutateyyxzRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () // CHECK: [[REG7:%.*]] = apply [[REG6]]<(τ_0_0).Element>([[REG4]]) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () // CHECK: [[REG8:%.*]] = end_apply [[REG5]] as $() // CHECK: end_access [[REG2]] // CHECK: [[REG10:%.*]] = begin_access [modify] [unknown] [[REG0]] -// CHECK: [[REG11:%.*]] = witness_method $τ_0_0, #P.prop2!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element +// CHECK: [[REG11:%.*]] = witness_method $τ_0_0, #P.prop2!modify : (inout Self) -> @yield_once () -> inout @yields Self.Element : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: ([[REG12:%.*]], [[REG13:%.*]]) = begin_apply [[REG11]]<τ_0_0>([[REG10]]) : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: [[REG14:%.*]] = function_ref @$s25borrow_accessor_synthesis6mutateyyxzRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () // CHECK: [[REG15:%.*]] = apply [[REG14]]<(τ_0_0).Element>([[REG12]]) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () // CHECK: [[REG16:%.*]] = end_apply [[REG13]] as $() // CHECK: end_access [[REG10]] // CHECK: [[REG18:%.*]] = begin_access [modify] [unknown] [[REG0]] -// CHECK: [[REG19:%.*]] = witness_method $τ_0_0, #P.prop3!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element +// CHECK: [[REG19:%.*]] = witness_method $τ_0_0, #P.prop3!modify : (inout Self) -> @yield_once () -> inout @yields Self.Element : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: ([[REG20:%.*]], [[REG21:%.*]]) = begin_apply [[REG19]]<τ_0_0>([[REG18]]) : $@yield_once @convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: [[REG22:%.*]] = function_ref @$s25borrow_accessor_synthesis6mutateyyxzRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () // CHECK: [[REG23:%.*]] = apply [[REG22]]<(τ_0_0).Element>([[REG20]]) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () @@ -188,19 +188,19 @@ func testP3(_ p: inout some P) { // CHECK: sil hidden [ossa] @$s25borrow_accessor_synthesis8testNCP1yyxAA3NCPRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : NCP> (@in_guaranteed τ_0_0) -> () { // CHECK: bb0([[REG0:%.*]] : $*τ_0_0): -// CHECK: [[REG2:%.*]] = witness_method $τ_0_0, #NCP.prop1!read : (Self) -> () -> () : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element +// CHECK: [[REG2:%.*]] = witness_method $τ_0_0, #NCP.prop1!read : (Self) -> @yield_once () -> @yields Self.Element : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: ([[REG3:%.*]], [[REG4:%.*]]) = begin_apply [[REG2]]<τ_0_0>([[REG0]]) : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: [[REG5:%.*]] = mark_unresolved_non_copyable_value [no_consume_or_assign] [[REG3]] // CHECK: [[REG6:%.*]] = function_ref @$s25borrow_accessor_synthesis3useyyxRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () // CHECK: [[REG7:%.*]] = apply [[REG6]]<(τ_0_0).Element>([[REG5]]) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () // CHECK: [[REG8:%.*]] = end_apply [[REG4]] as $() -// CHECK: [[REG9:%.*]] = witness_method $τ_0_0, #NCP.prop2!read : (Self) -> () -> () : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element +// CHECK: [[REG9:%.*]] = witness_method $τ_0_0, #NCP.prop2!read : (Self) -> @yield_once () -> @yields Self.Element : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: ([[REG10:%.*]], [[REG11:%.*]]) = begin_apply [[REG9]]<τ_0_0>([[REG0]]) : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: [[REG12:%.*]] = mark_unresolved_non_copyable_value [no_consume_or_assign] [[REG10]] // CHECK: [[REG13:%.*]] = function_ref @$s25borrow_accessor_synthesis3useyyxRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () // CHECK: [[REG14:%.*]] = apply [[REG13]]<(τ_0_0).Element>([[REG12]]) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () // CHECK: [[REG15:%.*]] = end_apply [[REG11]] as $() -// CHECK: [[REG16:%.*]] = witness_method $τ_0_0, #NCP.prop3!read : (Self) -> () -> () : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element +// CHECK: [[REG16:%.*]] = witness_method $τ_0_0, #NCP.prop3!read : (Self) -> @yield_once () -> @yields Self.Element : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: [[REG19:%.*]] = mark_unresolved_non_copyable_value [no_consume_or_assign] [[REG17]] // CHECK: [[REG20:%.*]] = function_ref @$s25borrow_accessor_synthesis3useyyxRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () // CHECK: [[REG21:%.*]] = apply [[REG20]]<(τ_0_0).Element>([[REG19]]) : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () @@ -215,7 +215,7 @@ func testNCP1(_ p: some NCP) { // CHECK: sil hidden [ossa] @$s25borrow_accessor_synthesis8testNCP2yyxzAA3NCPRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : NCP> (@inout τ_0_0) -> () { // CHECK: bb0([[REG0:%.*]] : $*τ_0_0): // CHECK: [[REG2:%.*]] = begin_access [modify] [unknown] [[REG0]] -// CHECK: [[REG3:%.*]] = witness_method $τ_0_0, #NCP.prop1!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element +// CHECK: [[REG3:%.*]] = witness_method $τ_0_0, #NCP.prop1!modify : (inout Self) -> @yield_once () -> inout @yields Self.Element : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: ([[REG4:%.*]], [[REG5:%.*]]) = begin_apply [[REG3]]<τ_0_0>([[REG2]]) : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: [[REG6:%.*]] = mark_unresolved_non_copyable_value [consumable_and_assignable] [[REG4]] // CHECK: [[REG7:%.*]] = function_ref @$s25borrow_accessor_synthesis6mutateyyxzRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () @@ -223,7 +223,7 @@ func testNCP1(_ p: some NCP) { // CHECK: [[REG9:%.*]] = end_apply [[REG5]] as $() // CHECK: end_access [[REG2]] // CHECK: [[REG11:%.*]] = begin_access [modify] [unknown] [[REG0]] -// CHECK: [[REG12:%.*]] = witness_method $τ_0_0, #NCP.prop2!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element +// CHECK: [[REG12:%.*]] = witness_method $τ_0_0, #NCP.prop2!modify : (inout Self) -> @yield_once () -> inout @yields Self.Element : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: ([[REG13:%.*]], [[REG14:%.*]]) = begin_apply [[REG12]]<τ_0_0>([[REG11]]) : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: [[REG15:%.*]] = mark_unresolved_non_copyable_value [consumable_and_assignable] [[REG13]] // CHECK: [[REG16:%.*]] = function_ref @$s25borrow_accessor_synthesis6mutateyyxzRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () @@ -231,7 +231,7 @@ func testNCP1(_ p: some NCP) { // CHECK: [[REG18:%.*]] = end_apply [[REG14]] as $() // CHECK: end_access [[REG11]] // CHECK: [[REG20:%.*]] = begin_access [modify] [unknown] [[REG0]] -// CHECK: [[REG21:%.*]] = witness_method $τ_0_0, #NCP.prop3!modify : (inout Self) -> () -> () : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element +// CHECK: [[REG21:%.*]] = witness_method $τ_0_0, #NCP.prop3!modify : (inout Self) -> @yield_once () -> inout @yields Self.Element : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: ([[REG22:%.*]], [[REG23:%.*]]) = begin_apply [[REG21]]<τ_0_0>([[REG20]]) : $@yield_once @convention(witness_method: NCP) <τ_0_0 where τ_0_0 : NCP, τ_0_0 : ~Copyable> (@inout τ_0_0) -> @yields @inout τ_0_0.Element // CHECK: [[REG24:%.*]] = mark_unresolved_non_copyable_value [consumable_and_assignable] [[REG22]] // CHECK: [[REG25:%.*]] = function_ref @$s25borrow_accessor_synthesis6mutateyyxzRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@inout τ_0_0) -> () @@ -464,7 +464,7 @@ public struct RigidWrapper: Container & ~Copyable { // CHECK: sil hidden [ossa] @$s25borrow_accessor_synthesis13testContaineryyx_SitAA0E0RzlF : $@convention(thin) (@in_guaranteed T, Int) -> () { // CHECK: bb0([[REG0:%.*]] : $*T, [[REG1:%.*]] : $Int): -// CHECK: [[REG4:%.*]] = witness_method $T, #Container.subscript!read : (Self) -> (Int) -> () : $@yield_once @convention(witness_method: Container) <τ_0_0 where τ_0_0 : Container, τ_0_0 : ~Copyable> (Int, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element +// CHECK: [[REG4:%.*]] = witness_method $T, #Container.subscript!read : (Self) -> @yield_once (Int) -> @yields Self.Element : $@yield_once @convention(witness_method: Container) <τ_0_0 where τ_0_0 : Container, τ_0_0 : ~Copyable> (Int, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: ([[REG5:%.*]], [[REG6:%.*]]) = begin_apply [[REG4]]([[REG1]], [[REG0]]) : $@yield_once @convention(witness_method: Container) <τ_0_0 where τ_0_0 : Container, τ_0_0 : ~Copyable> (Int, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // CHECK: [[REG7:%.*]] = mark_unresolved_non_copyable_value [no_consume_or_assign] [[REG5]] // CHECK: [[REG8:%.*]] = function_ref @$s25borrow_accessor_synthesis3useyyxRi_zlF : $@convention(thin) <τ_0_0 where τ_0_0 : ~Copyable> (@in_guaranteed τ_0_0) -> () diff --git a/test/SILGen/coroutine_subst_function_types.swift b/test/SILGen/coroutine_subst_function_types.swift index bb9443590ba42..0fd9b2dbab3d1 100644 --- a/test/SILGen/coroutine_subst_function_types.swift +++ b/test/SILGen/coroutine_subst_function_types.swift @@ -114,9 +114,9 @@ extension ConcreteWithInt : ProtoWithAssoc { } // CHECK-LABEL: sil_vtable ConcreteWithInt { -// CHECK: #Generic.generic!modify: (Generic) -> () -> () : @$s3mod15ConcreteWithIntC7genericSivMAA7GenericCADxvMTV [override] -// CHECK: #Generic.genericFunction!modify: (Generic) -> () -> () : @$s3mod15ConcreteWithIntC15genericFunctionSiycvMAA7GenericCADxycvMTV [override] -// CHECK: #Generic.subscript!modify: (Generic) -> (U) -> () : @$s3mod15ConcreteWithIntC16returningGenericSix_tcluiMAA0F0CADxqd___tcluiMTV [override] -// CHECK: #Generic.subscript!modify: (Generic) -> (U) -> () : @$s3mod15ConcreteWithIntC19returningOwnGenericxx_tcluiM [override] -// CHECK: #Generic.complexTuple!modify: (Generic) -> () -> () : @$s3mod15ConcreteWithIntC12complexTupleSiSg_SDySSSiGtvMAA7GenericCADxSg_SDySSxGtvMTV [override] +// CHECK: #Generic.generic!modify: (Generic) -> @yield_once () -> inout @yields T : @$s3mod15ConcreteWithIntC7genericSivMAA7GenericCADxvMTV [override] +// CHECK: #Generic.genericFunction!modify: (Generic) -> @yield_once () -> inout @yields () -> T : @$s3mod15ConcreteWithIntC15genericFunctionSiycvMAA7GenericCADxycvMTV [override] +// CHECK: #Generic.subscript!modify: (Generic) -> @yield_once (U) -> inout @yields T : @$s3mod15ConcreteWithIntC16returningGenericSix_tcluiMAA0F0CADxqd___tcluiMTV [override] +// CHECK: #Generic.subscript!modify: (Generic) -> @yield_once (U) -> inout @yields U : @$s3mod15ConcreteWithIntC19returningOwnGenericxx_tcluiM [override] +// CHECK: #Generic.complexTuple!modify: (Generic) -> @yield_once () -> inout @yields (T?, [String : T]) : @$s3mod15ConcreteWithIntC12complexTupleSiSg_SDySSSiGtvMAA7GenericCADxSg_SDySSxGtvMTV [override] // CHECK: } diff --git a/test/SILGen/default_override.swift b/test/SILGen/default_override.swift index f3db5b64847b0..b9aa3227b89b4 100644 --- a/test/SILGen/default_override.swift +++ b/test/SILGen/default_override.swift @@ -38,7 +38,7 @@ open class OpenBase { // CHECK-SAME: [[SELF:%[^,]+]] : // CHECK-SAME: ): // CHECK: [[ORIGINAL:%[^,]+]] = class_method [[SELF]], #OpenBase.openField!read -// CHECK-SAME: (OpenBase) -> () -> () +// CHECK-SAME: (OpenBase) -> @yield_once () -> @yields T // CHECK-SAME: $@yield_once @convention(method) <τ_0_0> (@guaranteed OpenBase<τ_0_0>) -> @yields @in_guaranteed τ_0_0 // CHECK: ([[ADDR:%[^,]+]], [[TOKEN:%[^,]+]]) = begin_apply [[ORIGINAL]]<τ_0_0>([[SELF]]) // CHECK: yield [[ADDR]] @@ -69,7 +69,7 @@ open class OpenBase { // CHECK-SAME: [[SELF:%[^,]+]] : // CHECK-SAME: ): // CHECK: [[ORIGINAL:%[^,]+]] = class_method [[SELF]], #OpenBase.openField!modify -// CHECK: (OpenBase) -> () -> () +// CHECK: (OpenBase) -> @yield_once () -> inout @yields T // CHECK: $@yield_once @convention(method) <τ_0_0> (@guaranteed OpenBase<τ_0_0>) -> @yields @inout τ_0_0 // CHECK: ([[ADDR:%[^,]+]], [[TOKEN:%[^,]+]]) = begin_apply [[ORIGINAL]]<τ_0_0>([[SELF]]) // CHECK: yield [[ADDR]] @@ -107,7 +107,7 @@ open class OpenBase { // CHECK-SAME: ): // CHECK: [[ORIGINAL:%[^,]+]] = class_method [[SELF]] // CHECK: #OpenBase.subscript!read -// CHECK: (OpenBase) -> (U, Open.Type) -> () +// CHECK: (OpenBase) -> @yield_once (U, Open.Type) -> @yields T // CHECK: $@yield_once @convention(method) <τ_0_0><τ_1_0> (@in_guaranteed τ_1_0, @thin Open.Type, @guaranteed OpenBase<τ_0_0>) -> @yields @in_guaranteed τ_0_0 // CHECK: ([[ADDR:%[^,]+]], [[TOKEN:%[^,]+]]) = begin_apply [[ORIGINAL]]<τ_0_0, τ_1_0>([[KEY]], [[OPEN_TY]], [[SELF]]) // CHECK: yield [[ADDR]] @@ -143,7 +143,7 @@ open class OpenBase { // CHECK-SAME: ): // CHECK: [[ORIGINAL:%[^,]+]] = class_method [[SELF]] // CHECK-SAME: #OpenBase.subscript!modify -// CHECK-SAME: (OpenBase) -> (U, Open.Type) -> () +// CHECK-SAME: (OpenBase) -> @yield_once (U, Open.Type) -> inout @yields T // CHECK-SAME: $@yield_once @convention(method) <τ_0_0><τ_1_0> (@in_guaranteed τ_1_0, @thin Open.Type, @guaranteed OpenBase<τ_0_0>) -> @yields @inout τ_0_0 // CHECK: ([[ADDR:%[^,]+]], [[TOKEN:%[^,]+]]) = begin_apply [[ORIGINAL]]<τ_0_0, τ_1_0>([[KEY]], [[OPEN_TY]], [[SELF]]) // CHECK: yield [[ADDR]] @@ -300,24 +300,24 @@ class InternalBase { // CHECK-LABEL: sil_default_override_table OpenBase { // CHECK-NEXT: #OpenBase.openField!read2 // CHECK-SAME: #OpenBase.openField!read -// CHECK-SAME: (OpenBase) -> () -> () +// CHECK-SAME: (OpenBase) -> @yield_once () -> @yields T // CHECK-SAME: @$s16default_override8OpenBaseC9openFieldxvyTwd // CHECK-NEXT: #OpenBase.openField!modify2 // CHECK-SAME: #OpenBase.openField!modify -// CHECK-SAME: (OpenBase) -> () -> () +// CHECK-SAME: (OpenBase) -> @yield_once () -> inout @yields T // CHECK-SAME: @$s16default_override8OpenBaseC9openFieldxvxTwd // CHECK-NEXT: #OpenBase.subscript!read2 // CHECK-SAME: #OpenBase.subscript!read -// CHECK-SAME: (OpenBase) -> (U, Open.Type) -> () +// CHECK-SAME: (OpenBase) -> @yield_once (U, Open.Type) -> @yields T // CHECK-SAME: @$s16default_override8OpenBaseCyxqd___AA0C0OmtcluiyTwd // CHECK-NEXT: #OpenBase.subscript!modify2 // CHECK-SAME: #OpenBase.subscript!modify -// CHECK-SAME: (OpenBase) -> (U, Open.Type) -> () +// CHECK-SAME: (OpenBase) -> @yield_once (U, Open.Type) -> inout @yields T // CHECK-SAME: @$s16default_override8OpenBaseCyxqd___AA0C0OmtcluixTwd // CHECK-NOT: #OpenBase.publicField!read2 // CHECK-NOT: #OpenBase.publicField!modify2 -// CHECK-NOT: #OpenBase.subscript!read2: #OpenBase.subscript!read: (OpenBase) -> (U, Public.Type) -> () -// CHECK-NOT: #OpenBase.subscript!modify2: #OpenBase.subscript!modify: (OpenBase) -> (U, Public.Type) -> () +// CHECK-NOT: #OpenBase.subscript!read2: #OpenBase.subscript!read: (OpenBase) -> @yield_once (U, Public.Type) -> @yields T +// CHECK-NOT: #OpenBase.subscript!modify2: #OpenBase.subscript!modify: (OpenBase) -> @yield_once (U, Public.Type) -> inout @yields T // CHECK-NEXT: } // CHECK-NOT: sil_default_override_table PublicBase { diff --git a/test/SILGen/ivar_destroyer_resilience.swift b/test/SILGen/ivar_destroyer_resilience.swift index 250358959967a..01b1c38cacab8 100644 --- a/test/SILGen/ivar_destroyer_resilience.swift +++ b/test/SILGen/ivar_destroyer_resilience.swift @@ -25,7 +25,7 @@ public class DoesNotNeedIVarDestroyer : Base { // CHECK-NEXT: #Base.init!allocator: (Base.Type) -> () -> Base // CHECK-NEXT: #NeedsIVarDestroyer.x!getter: (NeedsIVarDestroyer) -> () -> resilient_struct.ResilientInt // CHECK-NEXT: #NeedsIVarDestroyer.x!setter: (NeedsIVarDestroyer) -> (resilient_struct.ResilientInt) -> () -// CHECK-NEXT: #NeedsIVarDestroyer.x!modify: (NeedsIVarDestroyer) -> () -> () +// CHECK-NEXT: #NeedsIVarDestroyer.x!modify: (NeedsIVarDestroyer) -> @yield_once () -> inout @yields resilient_struct.ResilientInt // CHECK-NEXT: #NeedsIVarDestroyer.deinit!deallocator // CHECK-NEXT: #NeedsIVarDestroyer!ivardestroyer // CHECK-NEXT: } @@ -34,6 +34,6 @@ public class DoesNotNeedIVarDestroyer : Base { // CHECK-NEXT: #Base.init!allocator: (Base.Type) -> () -> Base // CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!getter: (DoesNotNeedIVarDestroyer) -> () -> MyResilientInt // CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!setter: (DoesNotNeedIVarDestroyer) -> (MyResilientInt) -> () -// CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!modify: (DoesNotNeedIVarDestroyer) -> () -> () +// CHECK-NEXT: #DoesNotNeedIVarDestroyer.x!modify: (DoesNotNeedIVarDestroyer) -> @yield_once () -> inout @yields MyResilientInt // CHECK-NEXT: #DoesNotNeedIVarDestroyer.deinit!deallocator // CHECK-NEXT: } diff --git a/test/SILGen/modify.swift b/test/SILGen/modify.swift index 92ea1deb4271a..d474fa721ce24 100644 --- a/test/SILGen/modify.swift +++ b/test/SILGen/modify.swift @@ -547,10 +547,10 @@ extension HasConditionalSubscript: ConditionalSubscript where T: ConditionalSubs // CHECK-LABEL: sil_vtable DerivedForOverride { // CHECK: #BaseForOverride.valueStored!getter: (BaseForOverride) -> () -> Int : @$s6modify18DerivedForOverrideC11valueStoredSivg // CHECK: #BaseForOverride.valueStored!setter: (BaseForOverride) -> (Int) -> () : @$s6modify18DerivedForOverrideC11valueStoredSivs -// CHECK: #BaseForOverride.valueStored!modify: (BaseForOverride) -> () -> () : @$s6modify18DerivedForOverrideC11valueStoredSivM +// CHECK: #BaseForOverride.valueStored!modify: (BaseForOverride) -> @yield_once () -> inout @yields Int : @$s6modify18DerivedForOverrideC11valueStoredSivM // CHECK: #BaseForOverride.valueComputed!getter: (BaseForOverride) -> () -> Int : @$s6modify18DerivedForOverrideC13valueComputedSivg // CHECK: #BaseForOverride.valueComputed!setter: (BaseForOverride) -> (Int) -> () : @$s6modify18DerivedForOverrideC13valueComputedSivs -// CHECK: #BaseForOverride.valueComputed!modify: (BaseForOverride) -> () -> () : @$s6modify18DerivedForOverrideC13valueComputedSivM +// CHECK: #BaseForOverride.valueComputed!modify: (BaseForOverride) -> @yield_once () -> inout @yields Int : @$s6modify18DerivedForOverrideC13valueComputedSivM // CHECK: } // CHECK-LABEL: sil_witness_table hidden Bill: Totalled module modify { diff --git a/test/SILGen/properties.swift b/test/SILGen/properties.swift index d15b1e7d7749c..d0daabdb63898 100644 --- a/test/SILGen/properties.swift +++ b/test/SILGen/properties.swift @@ -203,7 +203,7 @@ func logical_struct_in_reftype_set(_ value: inout Val, z1: Int) { // -- getters and setters // -- val.ref.val_prop // CHECK: [[BORROW:%.*]] = begin_borrow [[VAL_REF]] - // CHECK: [[MAT_VAL_PROP_METHOD:%[0-9]+]] = class_method {{.*}} : $Ref, #Ref.val_prop!modify : (Ref) -> () + // CHECK: [[MAT_VAL_PROP_METHOD:%[0-9]+]] = class_method {{.*}} : $Ref, #Ref.val_prop!modify : (Ref) -> @yield_once () -> inout @yields Val // CHECK: ([[VAL_REF_VAL_PROP_MAT:%[0-9]+]], [[TOKEN:%.*]]) = begin_apply [[MAT_VAL_PROP_METHOD]]([[BORROW]]) // -- val.ref.val_prop.z_tuple // CHECK: [[V_R_VP_Z_TUPLE_MAT:%[0-9]+]] = alloc_stack $(Int, Int) diff --git a/test/SILGen/property_wrappers.swift b/test/SILGen/property_wrappers.swift index b82d5f77f526a..eeca06c35a85e 100644 --- a/test/SILGen/property_wrappers.swift +++ b/test/SILGen/property_wrappers.swift @@ -1006,7 +1006,7 @@ struct S_58201 { // CHECK-LABEL: sil_vtable ClassUsingWrapper { // CHECK-NEXT: #ClassUsingWrapper.x!getter: (ClassUsingWrapper) -> () -> Int : @$s17property_wrappers17ClassUsingWrapperC1xSivg // ClassUsingWrapper.x.getter // CHECK-NEXT: #ClassUsingWrapper.x!setter: (ClassUsingWrapper) -> (Int) -> () : @$s17property_wrappers17ClassUsingWrapperC1xSivs // ClassUsingWrapper.x.setter -// CHECK-NEXT: #ClassUsingWrapper.x!modify: (ClassUsingWrapper) -> () -> () : @$s17property_wrappers17ClassUsingWrapperC1xSivM // ClassUsingWrapper.x.modify +// CHECK-NEXT: #ClassUsingWrapper.x!modify: (ClassUsingWrapper) -> @yield_once () -> inout @yields Int : @$s17property_wrappers17ClassUsingWrapperC1xSivM // ClassUsingWrapper.x.modify // CHECK-NEXT: #ClassUsingWrapper.init!allocator: (ClassUsingWrapper.Type) -> () -> ClassUsingWrapper : @$s17property_wrappers17ClassUsingWrapperCACycfC // CHECK-NEXT: #ClassUsingWrapper.deinit!deallocator: @$s17property_wrappers17ClassUsingWrapperCfD // CHECK-NEXT: } diff --git a/test/SILGen/property_wrappers_multifile.swift b/test/SILGen/property_wrappers_multifile.swift index 7c25657e68289..8b8131755656e 100644 --- a/test/SILGen/property_wrappers_multifile.swift +++ b/test/SILGen/property_wrappers_multifile.swift @@ -7,6 +7,6 @@ public class YourClass : MyClass {} // CHECK-NEXT: #MyClass.instanceProperty!getter: (MyClass) -> () -> Bool : @$s27property_wrappers_multifile7MyClassC16instancePropertySbvg [inherited] // CHECK-NEXT: #MyClass.$instanceProperty!getter: (MyClass) -> () -> PropertyWrapper : @$s27property_wrappers_multifile7MyClassC17$instancePropertyAA0G7WrapperVvg [inherited] // CHECK-NEXT: #MyClass.$instanceProperty!setter: (MyClass) -> (PropertyWrapper) -> () : @$s27property_wrappers_multifile7MyClassC17$instancePropertyAA0G7WrapperVvs [inherited] -// CHECK-NEXT: #MyClass.$instanceProperty!modify: (MyClass) -> () -> () : @$s27property_wrappers_multifile7MyClassC17$instancePropertyAA0G7WrapperVvM [inherited] +// CHECK-NEXT: #MyClass.$instanceProperty!modify: (MyClass) -> @yield_once () -> inout @yields PropertyWrapper : @$s27property_wrappers_multifile7MyClassC17$instancePropertyAA0G7WrapperVvM [inherited] // CHECK-NEXT: #YourClass.deinit!deallocator: @$s27property_wrappers_multifile9YourClassCfD -// CHECK-NEXT: } \ No newline at end of file +// CHECK-NEXT: } diff --git a/test/SILGen/sendable_to_any_for_generic_arguments.swift b/test/SILGen/sendable_to_any_for_generic_arguments.swift index 03c6589eb3f80..2a20f63519898 100644 --- a/test/SILGen/sendable_to_any_for_generic_arguments.swift +++ b/test/SILGen/sendable_to_any_for_generic_arguments.swift @@ -207,8 +207,8 @@ func test_subscript_computed_property_and_mutating_access(u: User) { // CHECK-NEXT: {{.*}} = apply [[SUBSCRIPT_GETTER]]({{.*}}, [[BORROWED_COPY]]) _ = u.dict[entry: ""] - // CHECK: [[DICT_GETTER:%.*]] = class_method %0, #User.dict!modify : (User) -> () -> (), $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary - // CHECK-NEXT: ([[DICT_ADDR:%.*]], {{.*}}) = begin_apply [[DICT_GETTER]]({{.*}}) : $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary + // CHECK: [[DICT_MODIFY:%.*]] = class_method %0, #User.dict!modify : (User) -> @yield_once () -> inout @yields [String : any Sendable], $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary + // CHECK-NEXT: ([[DICT_ADDR:%.*]], {{.*}}) = begin_apply [[DICT_MODIFY]]({{.*}}) : $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary // CHECK-NEXT: [[ANY_DICT:%.*]] = alloc_stack $Dictionary // CHECK-NEXT: [[LOADED_DICT:%.*]] = load [copy] [[DICT_ADDR]] // CHECK-NEXT: [[ANY_LOADED_DICT:%.*]] = unchecked_bitwise_cast [[LOADED_DICT]] to $Dictionary @@ -231,8 +231,8 @@ func test_subscript_computed_property_and_mutating_access(u: User) { // CHECK-NEXT: {{.*}} = apply [[GETTER]]([[ANY_DICT]]) : $@convention(method) (@guaranteed Dictionary) -> Optional _ = u.dict.test - // CHECK: [[DICT_GETTER:%.*]] = class_method %0, #User.dict!modify : (User) -> () -> (), $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary - // CHECK-NEXT: ([[DICT:%.*]], {{.*}}) = begin_apply [[DICT_GETTER]]({{.*}}) : $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary + // CHECK: [[DICT_MODIFY:%.*]] = class_method %0, #User.dict!modify : (User) -> @yield_once () -> inout @yields [String : any Sendable], $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary + // CHECK-NEXT: ([[DICT:%.*]], {{.*}}) = begin_apply [[DICT_MODIFY]]({{.*}}) : $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary // CHECK-NEXT: [[ANY_DICT:%.*]] = alloc_stack $Dictionary // CHECK-NEXT: [[LOADED_DICT:%.*]] = load [copy] [[DICT]] // CHECK-NEXT: [[CASTED_DICT:%.*]] = unchecked_bitwise_cast [[LOADED_DICT]] to $Dictionary @@ -246,8 +246,8 @@ func test_subscript_computed_property_and_mutating_access(u: User) { // CHECK-NEXT: assign [[COPIED_SENDABLE_DICT]] to [[DICT]] u.dict.test = 42 - // CHECK: [[DICT_GETTER:%.*]] = class_method %0, #User.dict!modify : (User) -> () -> (), $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary - // CHECK-NEXT: ([[DICT:%.*]], {{.*}}) = begin_apply [[DICT_GETTER:%.*]](%0) : $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary + // CHECK: [[DICT_MODIFY:%.*]] = class_method %0, #User.dict!modify : (User) -> @yield_once () -> inout @yields [String : any Sendable], $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary + // CHECK-NEXT: ([[DICT:%.*]], {{.*}}) = begin_apply [[DICT_MODIFY:%.*]](%0) : $@yield_once @convention(method) (@guaranteed User) -> @yields @inout Dictionary // CHECK-NEXT: [[ANY_DICT:%.*]] = alloc_stack $Dictionary // CHECK-NEXT: [[LOADED_DICT:%.*]] = load [copy] [[DICT]] // CHECK-NEXT: [[CASTED_DICT:%.*]] = unchecked_bitwise_cast [[LOADED_DICT]] to $Dictionary diff --git a/test/SILGen/witness-modify-requirement-with-base-class-modify.swift b/test/SILGen/witness-modify-requirement-with-base-class-modify.swift index 6186720b48a86..c5ffc2f60eabf 100644 --- a/test/SILGen/witness-modify-requirement-with-base-class-modify.swift +++ b/test/SILGen/witness-modify-requirement-with-base-class-modify.swift @@ -23,5 +23,5 @@ public class Derived : Base, Q where T.A == S {} // CHECK-LABEL: sil_witness_table [serialized] Derived: Q module main { // CHECK-NEXT: method #Q.foo!getter: (Self) -> () -> S? : @$s4main7DerivedCyxGAA1QA2aEP3fooAA1SVSgvgTW // CHECK-NEXT: method #Q.foo!setter: (inout Self) -> (S?) -> () : @$s4main7DerivedCyxGAA1QA2aEP3fooAA1SVSgvsTW -// CHECK-NEXT: method #Q.foo!modify: (inout Self) -> () -> () : @$s4main7DerivedCyxGAA1QA2aEP3fooAA1SVSgvMTW -// CHECK-NEXT: } \ No newline at end of file +// CHECK-NEXT: method #Q.foo!modify: (inout Self) -> @yield_once () -> inout @yields S? : @$s4main7DerivedCyxGAA1QA2aEP3fooAA1SVSgvMTW +// CHECK-NEXT: } diff --git a/test/SILOptimizer/access_dom_call.sil b/test/SILOptimizer/access_dom_call.sil index 44116736faf72..43e7f7ff875e8 100644 --- a/test/SILOptimizer/access_dom_call.sil +++ b/test/SILOptimizer/access_dom_call.sil @@ -121,7 +121,7 @@ bb2: // Preds: bb0 } // end sil function '$s1t1CC5fields5Int64VvM' sil_vtable C { - #C.field!modify: (C) -> () -> () : @CFieldModify + #C.field!modify: (C) -> @yield_once () -> inout @yields Int64 : @CFieldModify } // No, cannot optimize an access within a coroutine. @@ -134,7 +134,7 @@ bb0(%0 : $C): %ra = ref_element_addr %0 : $C, #C.field // user: %3 %a1 = begin_access [read] [dynamic] %ra : $*Int64 end_access %a1 : $*Int64 - %m = class_method %0 : $C, #C.field!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 + %m = class_method %0 : $C, #C.field!modify : (C) -> @yield_once () -> inout @yields Int64, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 (%3, %4) = begin_apply %m(%0) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 %a2 = begin_access [read] [dynamic] [no_nested_conflict] %ra : $*Int64 end_access %a2 : $*Int64 @@ -150,7 +150,7 @@ bb0(%0 : $C): // CHECK-LABEL: } // end sil function 'testDominatingRDA_RD' sil @testDominatingRDA_RD : $@convention(thin) (@guaranteed C) -> () { bb0(%0 : $C): - %m = class_method %0 : $C, #C.field!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 + %m = class_method %0 : $C, #C.field!modify : (C) -> @yield_once () -> inout @yields Int64, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 (%3, %4) = begin_apply %m(%0) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 %ra = ref_element_addr %0 : $C, #C.field // user: %3 %a1 = begin_access [read] [dynamic] %ra : $*Int64 @@ -169,7 +169,7 @@ bb0(%0 : $C): // CHECK-LABEL: } // end sil function 'testDominatingRDA_MD' sil @testDominatingRDA_MD : $@convention(thin) (@guaranteed C) -> () { bb0(%0 : $C): - %m = class_method %0 : $C, #C.field!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 + %m = class_method %0 : $C, #C.field!modify : (C) -> @yield_once () -> inout @yields Int64, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 (%3, %4) = begin_apply %m(%0) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 %ra = ref_element_addr %0 : $C, #C.field // user: %3 %a1 = begin_access [read] [dynamic] %ra : $*Int64 @@ -198,7 +198,7 @@ bb2: br bb3 bb3: - %m = class_method %0 : $C, #C.field!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 + %m = class_method %0 : $C, #C.field!modify : (C) -> @yield_once () -> inout @yields Int64, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 (%3, %4) = begin_apply %m(%0) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Int64 %ra = ref_element_addr %0 : $C, #C.field // user: %3 %a1 = begin_access [modify] [dynamic] [no_nested_conflict] %ra : $*Int64 diff --git a/test/SILOptimizer/address_lowering.sil b/test/SILOptimizer/address_lowering.sil index 6ce6bc53a62aa..7c788486de985 100644 --- a/test/SILOptimizer/address_lowering.sil +++ b/test/SILOptimizer/address_lowering.sil @@ -1725,7 +1725,7 @@ bb0: sil hidden [ossa] @testBeginApply1DeadYield : $@convention(thin) (@guaranteed TestGeneric) -> () { bb0(%0 : @guaranteed $TestGeneric): - %2 = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> () -> (), $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 + %2 = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> @yield_once () -> @yields T, $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 (%3, %4) = begin_apply %2(%0) : $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 end_apply %4 as $() %10 = tuple () @@ -1735,7 +1735,7 @@ bb0(%0 : @guaranteed $TestGeneric): // CHECK-LABEL: sil hidden [ossa] @testBeginApply2LoadableYieldWithIndirectConv : // CHECK: bb0(%0 : @guaranteed $TestGeneric): // CHECK: [[STK:%.*]] = alloc_stack $Klass -// CHECK: [[METH:%.*]] = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> () -> (), $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 +// CHECK: [[METH:%.*]] = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> @yield_once () -> @yields T, $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 // CHECK: ([[Y:%.*]], [[TOK:%.*]]) = begin_apply [[METH]](%0) : $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 // CHECK: copy_addr [[Y]] to [init] [[STK]] : $*Klass // CHECK: end_apply [[TOK]] as $() @@ -1743,7 +1743,7 @@ bb0(%0 : @guaranteed $TestGeneric): // CHECK-LABEL: } sil hidden [ossa] @testBeginApply2LoadableYieldWithIndirectConv : $@convention(thin) (@guaranteed TestGeneric) -> () { bb0(%0 : @guaranteed $TestGeneric): - %2 = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> () -> (), $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 + %2 = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> @yield_once () -> @yields Klass, $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 (%3, %4) = begin_apply %2(%0) : $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 %5 = copy_value %3 : $Klass end_apply %4 as $() @@ -1755,7 +1755,7 @@ bb0(%0 : @guaranteed $TestGeneric): // CHECK-LABEL: sil hidden [ossa] @testBeginApply3OpaqueYield : // CHECK: bb0(%0 : @guaranteed $TestGeneric): // CHECK: [[STK:%.*]] = alloc_stack $T -// CHECK: [[M:%.*]] = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> () -> (), $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 +// CHECK: [[M:%.*]] = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> @yield_once () -> @yields T, $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 // CHECK: ([[Y:%.*]], [[TOK:%.*]]) = begin_apply %2(%0) : $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 // CHECK: copy_addr [[Y]] to [init] [[STK]] : $*T // CHECK: end_apply [[TOK]] as $() @@ -1763,7 +1763,7 @@ bb0(%0 : @guaranteed $TestGeneric): // CHECK-LABEL: } // end sil function 'testBeginApply3OpaqueYield' sil hidden [ossa] @testBeginApply3OpaqueYield : $@convention(thin) (@guaranteed TestGeneric) -> () { bb0(%0 : @guaranteed $TestGeneric): - %2 = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> () -> (), $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 + %2 = class_method %0 : $TestGeneric, #TestGeneric.borrowedGeneric!read : (TestGeneric) -> @yield_once () -> @yields T, $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 (%3, %4) = begin_apply %2(%0) : $@yield_once @convention(method) <τ_0_0> (@guaranteed TestGeneric<τ_0_0>) -> @yields @in_guaranteed τ_0_0 %5 = copy_value %3 : $T end_apply %4 as $() diff --git a/test/SILOptimizer/devirtualize_coroutine_accessors.sil b/test/SILOptimizer/devirtualize_coroutine_accessors.sil index 1e7dfecff9415..355af807fb623 100644 --- a/test/SILOptimizer/devirtualize_coroutine_accessors.sil +++ b/test/SILOptimizer/devirtualize_coroutine_accessors.sil @@ -29,7 +29,7 @@ sil [ossa] @utilize_begin_apply : $@convention(thin) () -> () { bb0: %derived = alloc_ref $Derived %base = upcast %derived : $Derived to $Base - %reader = class_method %base : $Base, #Base.x!read2 : (Base) -> () -> (), $@yield_once_2 @convention(method) (@guaranteed Base) -> @yields Int + %reader = class_method %base : $Base, #Base.x!read2 : (Base) -> @yield_once () -> @yields Int, $@yield_once_2 @convention(method) (@guaranteed Base) -> @yields Int (%value, %token, %allocation) = begin_apply %reader(%base) : $@yield_once_2 @convention(method) (@guaranteed Base) -> @yields Int end_apply %token as $() dealloc_stack %allocation : $*Builtin.SILToken diff --git a/test/SILOptimizer/lifetime_dependence/lifetime_dependence_util.sil b/test/SILOptimizer/lifetime_dependence/lifetime_dependence_util.sil index 65aaaf3d59441..00cf39a281023 100644 --- a/test/SILOptimizer/lifetime_dependence/lifetime_dependence_util.sil +++ b/test/SILOptimizer/lifetime_dependence/lifetime_dependence_util.sil @@ -151,7 +151,7 @@ entry(%0 : @owned $C, %1 : @owned $D, %2 : @guaranteed $D, %3 : $*D, %4 : $*D): // CHECK-NEXT: ends: end_borrow {{.*}} : $D // CHECK: dependence_scope: lifetime_dependence_scope with: %guaranteed_mark - %m = class_method %2 : $D, #D.field!read : (D) -> () -> (), $@yield_once @convention(method) (@guaranteed D) -> @yields @guaranteed C + %m = class_method %2 : $D, #D.field!read : (D) -> @yield_once () -> @yields C, $@yield_once @convention(method) (@guaranteed D) -> @yields @guaranteed C (%yield, %token) = begin_apply %m(%2) : $@yield_once @convention(method) (@guaranteed D) -> @yields @guaranteed C %yield_mark = mark_dependence [nonescaping] %guaranteed_mark : $C on %yield : $C specify_test "lifetime_dependence_scope %yield_mark" diff --git a/test/SILOptimizer/liveness_unit.sil b/test/SILOptimizer/liveness_unit.sil index f59659aeff7f0..f09d23384ae0b 100644 --- a/test/SILOptimizer/liveness_unit.sil +++ b/test/SILOptimizer/liveness_unit.sil @@ -142,7 +142,7 @@ bb0(%0 : @owned $D): sil [ossa] @testGuaranteedResult : $@convention(thin) (@guaranteed D) -> () { bb0(%0 : @guaranteed $D): specify_test "ssa_liveness @argument[0]" - %2 = class_method %0 : $D, #D.borrowed!read : (D) -> () -> (), $@yield_once @convention(method) (@guaranteed D) -> @yields @guaranteed C + %2 = class_method %0 : $D, #D.borrowed!read : (D) -> @yield_once () -> @yields C, $@yield_once @convention(method) (@guaranteed D) -> @yields @guaranteed C (%3, %4) = begin_apply %2(%0) : $@yield_once @convention(method) (@guaranteed D) -> @yields @guaranteed C end_apply %4 as $() %99 = tuple() diff --git a/test/SILOptimizer/mandatory_combiner_opt.sil b/test/SILOptimizer/mandatory_combiner_opt.sil index ea63669871724..a16d1563ffeeb 100644 --- a/test/SILOptimizer/mandatory_combiner_opt.sil +++ b/test/SILOptimizer/mandatory_combiner_opt.sil @@ -118,7 +118,7 @@ class C { // CHECK-LABEL: sil hidden [ossa] @testCoroutineBorrow : $@convention(thin) (@owned C, Builtin.Int64) -> () { // CHECK-LABEL: bb0(%0 : @owned $C, %1 : $Builtin.Int64): // CHECK-NOT: borrow -// CHECK: class_method %0 : $C, #C.float!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Builtin.Int64 +// CHECK: class_method %0 : $C, #C.float!modify : (C) -> @yield_once () -> inout @yields Builtin.Int64, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Builtin.Int64 // CHECK: begin_apply %{{.*}}(%0) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Builtin.Int64 // CHECK-NOT: borrow // CHECK: destroy_value %0 : $C @@ -126,7 +126,7 @@ class C { sil hidden [ossa] @testCoroutineBorrow : $@convention(thin) (@owned C, Builtin.Int64) -> () { bb0(%0 : @owned $C, %1 : $Builtin.Int64): %14 = begin_borrow %0 : $C - %15 = class_method %14 : $C, #C.float!modify : (C) -> () -> (), $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Builtin.Int64 + %15 = class_method %14 : $C, #C.float!modify : (C) -> @yield_once () -> inout @yields Builtin.Int64, $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Builtin.Int64 (%16, %17) = begin_apply %15(%14) : $@yield_once @convention(method) (@guaranteed C) -> @yields @inout Builtin.Int64 store %1 to [trivial] %16 : $*Builtin.Int64 end_apply %17 as $() diff --git a/test/SILOptimizer/mandatory_inlining_ownership.sil b/test/SILOptimizer/mandatory_inlining_ownership.sil index 73adf0d336f1b..dce28f5ba2e72 100644 --- a/test/SILOptimizer/mandatory_inlining_ownership.sil +++ b/test/SILOptimizer/mandatory_inlining_ownership.sil @@ -569,7 +569,7 @@ bb2: // CHECK: } // end sil function 'begin_apply_devirt_caller' sil [ossa] @begin_apply_devirt_caller : $@convention(method) (@owned C2) -> @error Error { bb0(%0 : @owned $C2): - %1 = class_method %0 : $C2, #C2.i!modify : (C2) -> () -> (), $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 + %1 = class_method %0 : $C2, #C2.i!modify : (C2) -> @yield_once () -> inout @yields Builtin.Int64, $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 (%mem, %tok) = begin_apply %1(%0) : $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 br bb1 @@ -585,7 +585,7 @@ bb1: // CHECK: } // end sil function 'begin_apply_devirt_caller_2' sil [ossa] @begin_apply_devirt_caller_2 : $@convention(method) (@owned C2) -> @error Error { bb0(%0 : @owned $C2): - %1 = class_method %0 : $C2, #C2.i!modify : (C2) -> () -> (), $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 + %1 = class_method %0 : $C2, #C2.i!modify : (C2) -> @yield_once () -> inout @yields Builtin.Int64, $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 (%mem, %tok) = begin_apply %1(%0) : $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 br bb1 @@ -601,7 +601,7 @@ bb1: // CHECK: } // end sil function 'begin_apply_devirt_caller_3' sil [ossa] @begin_apply_devirt_caller_3 : $@convention(method) (@owned C2) -> @error Error { bb0(%0 : @owned $C2): - %1 = class_method %0 : $C2, #C2.i!modify : (C2) -> () -> (), $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 + %1 = class_method %0 : $C2, #C2.i!modify : (C2) -> @yield_once () -> inout @yields Builtin.Int64, $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 (%mem, %tok) = begin_apply %1(%0) : $@yield_once @convention(method) (@guaranteed C2) -> @yields @inout Builtin.Int64 cond_br undef, bb1, bb2 @@ -656,5 +656,5 @@ bb0(%0 : $Int): } sil_vtable C2 { - #C2.i!modify: (C2) -> () -> () : @devirt_callee + #C2.i!modify: (C2) -> @yield_once () -> inout @yields Builtin.Int64 : @devirt_callee } diff --git a/test/SILOptimizer/package-cmo-deserialize-for-external-client.swift b/test/SILOptimizer/package-cmo-deserialize-for-external-client.swift index 2b258cbfa53b5..a5a69ac10e0b6 100644 --- a/test/SILOptimizer/package-cmo-deserialize-for-external-client.swift +++ b/test/SILOptimizer/package-cmo-deserialize-for-external-client.swift @@ -30,17 +30,17 @@ // CHECK-INPKG: sil_vtable Pub { // CHECK-INPKG: #Pub.pubVar!getter: (Pub) -> () -> Int : @$s3Lib3PubC6pubVarSivg // Pub.pubVar.getter // CHECK-INPKG: #Pub.pubVar!setter: (Pub) -> (Int) -> () : @$s3Lib3PubC6pubVarSivs // Pub.pubVar.setter -// CHECK-INPKG: #Pub.pubVar!modify: (Pub) -> () -> () : @$s3Lib3PubC6pubVarSivM // Pub.pubVar.modify +// CHECK-INPKG: #Pub.pubVar!modify: (Pub) -> @yield_once () -> inout @yields Int : @$s3Lib3PubC6pubVarSivM // Pub.pubVar.modify // CHECK-INPKG: #Pub.pkgVar!getter: (Pub) -> () -> Int : @$s3Lib3PubC6pkgVarSivg // Pub.pkgVar.getter // CHECK-INPKG: #Pub.pkgVar!setter: (Pub) -> (Int) -> () : @$s3Lib3PubC6pkgVarSivs // Pub.pkgVar.setter -// CHECK-INPKG: #Pub.pkgVar!modify: (Pub) -> () -> () : @$s3Lib3PubC6pkgVarSivM // Pub.pkgVar.modify +// CHECK-INPKG: #Pub.pkgVar!modify: (Pub) -> @yield_once () -> inout @yields Int : @$s3Lib3PubC6pkgVarSivM // Pub.pkgVar.modify // CHECK-INPKG: #Pub.init!allocator: (Pub.Type) -> (Int) -> Pub : @$s3Lib3PubCyACSicfC // Pub.__allocating_init(_:) // CHECK-INPKG: #Pub.deinit!deallocator: @$s3Lib3PubCfD // Pub.__deallocating_deinit // CHECK-INPKG: sil_witness_table public_external Pub: PubProto module Lib { // CHECK-INPKG: method #PubProto.pubVar!getter: (Self) -> () -> Int : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivgTW // protocol witness for PubProto.pubVar.getter in conformance Pub // CHECK-INPKG: method #PubProto.pubVar!setter: (inout Self) -> (Int) -> () : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivsTW // protocol witness for PubProto.pubVar.setter in conformance Pub -// CHECK-INPKG: method #PubProto.pubVar!modify: (inout Self) -> () -> () : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivMTW // protocol witness for PubProto.pubVar.modify in conformance Pub +// CHECK-INPKG: method #PubProto.pubVar!modify: (inout Self) -> @yield_once () -> inout @yields Int : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivMTW // protocol witness for PubProto.pubVar.modify in conformance Pub /// Test 2: They should NOT be deserialized into Client as Lib and Client are NOT in the same package; @@ -78,17 +78,17 @@ // CHECK-LIB: sil_vtable [serialized_for_package] Pub { // CHECK-LIB: #Pub.pubVar!getter: (Pub) -> () -> Int : @$s3Lib3PubC6pubVarSivg // Pub.pubVar.getter // CHECK-LIB: #Pub.pubVar!setter: (Pub) -> (Int) -> () : @$s3Lib3PubC6pubVarSivs // Pub.pubVar.setter -// CHECK-LIB: #Pub.pubVar!modify: (Pub) -> () -> () : @$s3Lib3PubC6pubVarSivM // Pub.pubVar.modify +// CHECK-LIB: #Pub.pubVar!modify: (Pub) -> @yield_once () -> inout @yields Int : @$s3Lib3PubC6pubVarSivM // Pub.pubVar.modify // CHECK-LIB: #Pub.pkgVar!getter: (Pub) -> () -> Int : @$s3Lib3PubC6pkgVarSivg // Pub.pkgVar.getter // CHECK-LIB: #Pub.pkgVar!setter: (Pub) -> (Int) -> () : @$s3Lib3PubC6pkgVarSivs // Pub.pkgVar.setter -// CHECK-LIB: #Pub.pkgVar!modify: (Pub) -> () -> () : @$s3Lib3PubC6pkgVarSivM // Pub.pkgVar.modify +// CHECK-LIB: #Pub.pkgVar!modify: (Pub) -> @yield_once () -> inout @yields Int : @$s3Lib3PubC6pkgVarSivM // Pub.pkgVar.modify // CHECK-LIB: #Pub.init!allocator: (Pub.Type) -> (Int) -> Pub : @$s3Lib3PubCyACSicfC // Pub.__allocating_init(_:) // CHECK-LIB: #Pub.deinit!deallocator: @$s3Lib3PubCfD // Pub.__deallocating_deinit // CHECK-LIB: sil_witness_table [serialized_for_package] Pub: PubProto module Lib { // CHECK-LIB: method #PubProto.pubVar!getter: (Self) -> () -> Int : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivgTW // protocol witness for PubProto.pubVar.getter in conformance Pub // CHECK-LIB: method #PubProto.pubVar!setter: (inout Self) -> (Int) -> () : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivsTW // protocol witness for PubProto.pubVar.setter in conformance Pub -// CHECK-LIB: method #PubProto.pubVar!modify: (inout Self) -> () -> () : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivMTW // protocol witness for PubProto.pubVar.modify in conformance Pub +// CHECK-LIB: method #PubProto.pubVar!modify: (inout Self) -> @yield_once () -> inout @yields Int : @$s3Lib3PubCAA0B5ProtoA2aDP6pubVarSivMTW // protocol witness for PubProto.pubVar.modify in conformance Pub //--- Lib.swift diff --git a/test/SILOptimizer/package-cmo-resilient-mode.swift b/test/SILOptimizer/package-cmo-resilient-mode.swift index ccd1c6348a20c..59fd511b38a60 100644 --- a/test/SILOptimizer/package-cmo-resilient-mode.swift +++ b/test/SILOptimizer/package-cmo-resilient-mode.swift @@ -536,7 +536,7 @@ final package class FinalPkgKlass { // CHECK-NONRES-LABEL: sil_vtable [serialized] PubKlass { // CHECK-COMMON-NEXT: #PubKlass.data!getter: (PubKlass) -> () -> Int : @$s3Lib8PubKlassC4dataSivg // CHECK-COMMON-NEXT: #PubKlass.data!setter: (PubKlass) -> (Int) -> () : @$s3Lib8PubKlassC4dataSivs -// CHECK-COMMON-NEXT: #PubKlass.data!modify: (PubKlass) -> () -> () : @$s3Lib8PubKlassC4dataSivM +// CHECK-COMMON-NEXT: #PubKlass.data!modify: (PubKlass) -> @yield_once () -> inout @yields Int : @$s3Lib8PubKlassC4dataSivM // CHECK-COMMON-NEXT: #PubKlass.init!allocator: (PubKlass.Type) -> (Int) -> PubKlass : @$s3Lib8PubKlassCyACSicfC // CHECK-COMMON-NEXT: #PubKlass.pubfunc: (PubKlass) -> (Int) -> Int : @$s3Lib8PubKlassC7pubfuncyS2iF // CHECK-COMMON-NEXT: #PubKlass.deinit!deallocator: @$s3Lib8PubKlassCfD @@ -549,7 +549,7 @@ final package class FinalPkgKlass { // CHECK-RES-LABEL: sil_vtable [serialized_for_package] PkgKlass { // CHECK-RES-NEXT: #PkgKlass.data!getter: (PkgKlass) -> () -> Int : @$s3Lib8PkgKlassC4dataSivg // CHECK-RES-NEXT: #PkgKlass.data!setter: (PkgKlass) -> (Int) -> () : @$s3Lib8PkgKlassC4dataSivs -// CHECK-RES-NEXT: #PkgKlass.data!modify: (PkgKlass) -> () -> () : @$s3Lib8PkgKlassC4dataSivM +// CHECK-RES-NEXT: #PkgKlass.data!modify: (PkgKlass) -> @yield_once () -> inout @yields Int : @$s3Lib8PkgKlassC4dataSivM // CHECK-RES-NEXT: #PkgKlass.init!allocator: (PkgKlass.Type) -> (Int) -> PkgKlass : @$s3Lib8PkgKlassCyACSicfC // CHECK-RES-NEXT: #PkgKlass.pkgfunc: (PkgKlass) -> (Int) -> Int : @$s3Lib8PkgKlassC7pkgfuncyS2iF // CHECK-RES-NEXT: #PkgKlass.deinit!deallocator: @$s3Lib8PkgKlassCfD @@ -562,11 +562,11 @@ final package class FinalPkgKlass { // CHECK-NONRES-LABEL: sil_witness_table [serialized] PubKlass: PubProto module Lib { // CHECK-COMMON-NEXT: method #PubProto.data!getter: (Self) -> () -> Int : @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivgTW // CHECK-COMMON-NEXT: method #PubProto.data!setter: (inout Self) -> (Int) -> () : @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivsTW -// CHECK-COMMON-NEXT: method #PubProto.data!modify: (inout Self) -> () -> () : @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivMTW +// CHECK-COMMON-NEXT: method #PubProto.data!modify: (inout Self) -> @yield_once () -> inout @yields Int : @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivMTW // CHECK-COMMON-NEXT: method #PubProto.pubfunc: (Self) -> (Int) -> Int : @$s3Lib8PubKlassCAA0B5ProtoA2aDP7pubfuncyS2iFTW // CHECK-RES-LABEL: sil_witness_table package [serialized_for_package] PkgKlass: PkgProto module Lib { // CHECK-RES-NEXT: method #PkgProto.data!getter: (Self) -> () -> Int : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivgTW // CHECK-RES-NEXT: method #PkgProto.data!setter: (inout Self) -> (Int) -> () : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivsTW -// CHECK-RES-NEXT: method #PkgProto.data!modify: (inout Self) -> () -> () : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivMTW +// CHECK-RES-NEXT: method #PkgProto.data!modify: (inout Self) -> @yield_once () -> inout @yields Int : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivMTW // CHECK-RES-NEXT: method #PkgProto.pkgfunc: (Self) -> (Int) -> Int : @$s3Lib8PkgKlassCAA0B5ProtoA2aDP7pkgfuncyS2iFTW diff --git a/test/SILOptimizer/package-cmo-serialize-tables.swift b/test/SILOptimizer/package-cmo-serialize-tables.swift index e21f8b508b450..1f1d72a4f8e73 100644 --- a/test/SILOptimizer/package-cmo-serialize-tables.swift +++ b/test/SILOptimizer/package-cmo-serialize-tables.swift @@ -474,7 +474,7 @@ package func runPkg(_ arg: [any PkgProto]) { // CHECK-LABEL: sil_vtable [serialized_for_package] ParentPubKlass { // CHECK-NEXT: #ParentPubKlass.parentPubVar!getter: (ParentPubKlass) -> () -> Int : @$s3Lib14ParentPubKlassC06parentC3VarSivg // ParentPubKlass.parentPubVar.getter // CHECK-NEXT: #ParentPubKlass.parentPubVar!setter: (ParentPubKlass) -> (Int) -> () : @$s3Lib14ParentPubKlassC06parentC3VarSivs // ParentPubKlass.parentPubVar.setter -// CHECK-NEXT: #ParentPubKlass.parentPubVar!modify: (ParentPubKlass) -> () -> () : @$s3Lib14ParentPubKlassC06parentC3VarSivM // ParentPubKlass.parentPubVar.modify +// CHECK-NEXT: #ParentPubKlass.parentPubVar!modify: (ParentPubKlass) -> @yield_once () -> inout @yields Int : @$s3Lib14ParentPubKlassC06parentC3VarSivM // ParentPubKlass.parentPubVar.modify // CHECK-NEXT: #ParentPubKlass.init!allocator: (ParentPubKlass.Type) -> (Int) -> ParentPubKlass : @$s3Lib14ParentPubKlassCyACSicfC // ParentPubKlass.__allocating_init(_:) // CHECK-NEXT: #ParentPubKlass.parentPubFunc: (ParentPubKlass) -> () -> () : @$s3Lib14ParentPubKlassC06parentC4FuncyyF // ParentPubKlass.parentPubFunc() // CHECK-NEXT: #ParentPubKlass.deinit!deallocator: @$s3Lib14ParentPubKlassCfD // ParentPubKlass.__deallocating_deinit @@ -482,12 +482,12 @@ package func runPkg(_ arg: [any PkgProto]) { // CHECK-LABEL: sil_vtable [serialized_for_package] PubKlass { // CHECK-NEXT: #ParentPubKlass.parentPubVar!getter: (ParentPubKlass) -> () -> Int : @$s3Lib14ParentPubKlassC06parentC3VarSivg [inherited] // ParentPubKlass.parentPubVar.getter // CHECK-NEXT: #ParentPubKlass.parentPubVar!setter: (ParentPubKlass) -> (Int) -> () : @$s3Lib14ParentPubKlassC06parentC3VarSivs [inherited] // ParentPubKlass.parentPubVar.setter -// CHECK-NEXT: #ParentPubKlass.parentPubVar!modify: (ParentPubKlass) -> () -> () : @$s3Lib14ParentPubKlassC06parentC3VarSivM [inherited] // ParentPubKlass.parentPubVar.modify +// CHECK-NEXT: #ParentPubKlass.parentPubVar!modify: (ParentPubKlass) -> @yield_once () -> inout @yields Int : @$s3Lib14ParentPubKlassC06parentC3VarSivM [inherited] // ParentPubKlass.parentPubVar.modify // CHECK-NEXT: #ParentPubKlass.init!allocator: (ParentPubKlass.Type) -> (Int) -> ParentPubKlass : @$s3Lib8PubKlassCyACSicfC [override] // PubKlass.__allocating_init(_:) // CHECK-NEXT: #ParentPubKlass.parentPubFunc: (ParentPubKlass) -> () -> () : @$s3Lib8PubKlassC06parentB4FuncyyF [override] // PubKlass.parentPubFunc() // CHECK-NEXT: #PubKlass.pubVar!getter: (PubKlass) -> () -> String : @$s3Lib8PubKlassC6pubVarSSvg // PubKlass.pubVar.getter // CHECK-NEXT: #PubKlass.pubVar!setter: (PubKlass) -> (String) -> () : @$s3Lib8PubKlassC6pubVarSSvs // PubKlass.pubVar.setter -// CHECK-NEXT: #PubKlass.pubVar!modify: (PubKlass) -> () -> () : @$s3Lib8PubKlassC6pubVarSSvM // PubKlass.pubVar.modify +// CHECK-NEXT: #PubKlass.pubVar!modify: (PubKlass) -> @yield_once () -> inout @yields String : @$s3Lib8PubKlassC6pubVarSSvM // PubKlass.pubVar.modify // CHECK-NEXT: #PubKlass.init!allocator: (PubKlass.Type) -> (String) -> PubKlass : @$s3Lib8PubKlassCyACSScfC // PubKlass.__allocating_init(_:) // CHECK-NEXT: #PubKlass.pubFunc: (PubKlass) -> () -> () : @$s3Lib8PubKlassC7pubFuncyyF // PubKlass.pubFunc() // CHECK-NEXT: #PubKlass.deinit!deallocator: @$s3Lib8PubKlassCfD // PubKlass.__deallocating_deinit @@ -496,7 +496,7 @@ package func runPkg(_ arg: [any PkgProto]) { // CHECK-LABEL: sil_vtable [serialized_for_package] ParentPkgKlass { // CHECK-NEXT: #ParentPkgKlass.parentPkgVar!getter: (ParentPkgKlass) -> () -> Int : @$s3Lib14ParentPkgKlassC06parentC3VarSivg // ParentPkgKlass.parentPkgVar.getter // CHECK-NEXT: #ParentPkgKlass.parentPkgVar!setter: (ParentPkgKlass) -> (Int) -> () : @$s3Lib14ParentPkgKlassC06parentC3VarSivs // ParentPkgKlass.parentPkgVar.setter -// CHECK-NEXT: #ParentPkgKlass.parentPkgVar!modify: (ParentPkgKlass) -> () -> () : @$s3Lib14ParentPkgKlassC06parentC3VarSivM // ParentPkgKlass.parentPkgVar.modify +// CHECK-NEXT: #ParentPkgKlass.parentPkgVar!modify: (ParentPkgKlass) -> @yield_once () -> inout @yields Int : @$s3Lib14ParentPkgKlassC06parentC3VarSivM // ParentPkgKlass.parentPkgVar.modify // CHECK-NEXT: #ParentPkgKlass.init!allocator: (ParentPkgKlass.Type) -> (Int) -> ParentPkgKlass : @$s3Lib14ParentPkgKlassCyACSicfC // ParentPkgKlass.__allocating_init(_:) // CHECK-NEXT: #ParentPkgKlass.parentPkgFunc: (ParentPkgKlass) -> () -> Int : @$s3Lib14ParentPkgKlassC06parentC4FuncSiyF // ParentPkgKlass.parentPkgFunc() // CHECK-NEXT: #ParentPkgKlass.deinit!deallocator: @$s3Lib14ParentPkgKlassCfD // ParentPkgKlass.__deallocating_deinit @@ -504,12 +504,12 @@ package func runPkg(_ arg: [any PkgProto]) { // CHECK-LABEL: sil_vtable [serialized_for_package] PkgKlass { // CHECK-NEXT: #ParentPkgKlass.parentPkgVar!getter: (ParentPkgKlass) -> () -> Int : @$s3Lib14ParentPkgKlassC06parentC3VarSivg [inherited] // ParentPkgKlass.parentPkgVar.getter // CHECK-NEXT: #ParentPkgKlass.parentPkgVar!setter: (ParentPkgKlass) -> (Int) -> () : @$s3Lib14ParentPkgKlassC06parentC3VarSivs [inherited] // ParentPkgKlass.parentPkgVar.setter -// CHECK-NEXT: #ParentPkgKlass.parentPkgVar!modify: (ParentPkgKlass) -> () -> () : @$s3Lib14ParentPkgKlassC06parentC3VarSivM [inherited] // ParentPkgKlass.parentPkgVar.modify +// CHECK-NEXT: #ParentPkgKlass.parentPkgVar!modify: (ParentPkgKlass) -> @yield_once () -> inout @yields Int : @$s3Lib14ParentPkgKlassC06parentC3VarSivM [inherited] // ParentPkgKlass.parentPkgVar.modify // CHECK-NEXT: #ParentPkgKlass.init!allocator: (ParentPkgKlass.Type) -> (Int) -> ParentPkgKlass : @$s3Lib8PkgKlassCyACSicfC [override] // PkgKlass.__allocating_init(_:) // CHECK-NEXT: #ParentPkgKlass.parentPkgFunc: (ParentPkgKlass) -> () -> Int : @$s3Lib8PkgKlassC06parentB4FuncSiyF [override] // PkgKlass.parentPkgFunc() // CHECK-NEXT: #PkgKlass.pkgVar!getter: (PkgKlass) -> () -> String : @$s3Lib8PkgKlassC6pkgVarSSvg // PkgKlass.pkgVar.getter // CHECK-NEXT: #PkgKlass.pkgVar!setter: (PkgKlass) -> (String) -> () : @$s3Lib8PkgKlassC6pkgVarSSvs // PkgKlass.pkgVar.setter -// CHECK-NEXT: #PkgKlass.pkgVar!modify: (PkgKlass) -> () -> () : @$s3Lib8PkgKlassC6pkgVarSSvM // PkgKlass.pkgVar.modify +// CHECK-NEXT: #PkgKlass.pkgVar!modify: (PkgKlass) -> @yield_once () -> inout @yields String : @$s3Lib8PkgKlassC6pkgVarSSvM // PkgKlass.pkgVar.modify // CHECK-NEXT: #PkgKlass.init!allocator: (PkgKlass.Type) -> (String) -> PkgKlass : @$s3Lib8PkgKlassCyACSScfC // PkgKlass.__allocating_init(_:) // CHECK-NEXT: #PkgKlass.pkgFunc: (PkgKlass) -> () -> () : @$s3Lib8PkgKlassC7pkgFuncyyF // PkgKlass.pkgFunc() // CHECK-NEXT: #PkgKlass.deinit!deallocator: @$s3Lib8PkgKlassCfD // PkgKlass.__deallocating_deinit @@ -518,7 +518,7 @@ package func runPkg(_ arg: [any PkgProto]) { // CHECK-LABEL: sil_vtable [serialized_for_package] PubKlassZ { // CHECK-NEXT: #PubKlassZ.env!getter: (PubKlassZ) -> () -> UInt16 : @$s3Lib9PubKlassZC3envs6UInt16Vvg // PubKlassZ.env.getter // CHECK-NEXT: #PubKlassZ.env!setter: (PubKlassZ) -> (UInt16) -> () : @$s3Lib9PubKlassZC3envs6UInt16Vvs // PubKlassZ.env.setter -// CHECK-NEXT: #PubKlassZ.env!modify: (PubKlassZ) -> () -> () : @$s3Lib9PubKlassZC3envs6UInt16VvM // PubKlassZ.env.modify +// CHECK-NEXT: #PubKlassZ.env!modify: (PubKlassZ) -> @yield_once () -> inout @yields UInt16 : @$s3Lib9PubKlassZC3envs6UInt16VvM // PubKlassZ.env.modify // CHECK-NEXT: #PubKlassZ.init!allocator: (PubKlassZ.Type) -> (UInt16) -> PubKlassZ : @$s3Lib9PubKlassZC8rawValueACs6UInt16V_tcfC // PubKlassZ.__allocating_init(rawValue:) // CHECK-NEXT: #PubKlassZ.pubFunc: (PubKlassZ) -> () -> () : @$s3Lib9PubKlassZC7pubFuncyyF // PubKlassZ.pubFunc() // CHECK-NEXT: #PubKlassZ.deinit!deallocator: @$s3Lib9PubKlassZCfD // PubKlassZ.__deallocating_deinit @@ -527,7 +527,7 @@ package func runPkg(_ arg: [any PkgProto]) { // CHECK-LABEL: sil_vtable [serialized_for_package] PkgKlassZ { // CHECK-NEXT: #PkgKlassZ.env!getter: (PkgKlassZ) -> () -> UInt16 : @$s3Lib9PkgKlassZC3envs6UInt16Vvg // PkgKlassZ.env.getter // CHECK-NEXT: #PkgKlassZ.env!setter: (PkgKlassZ) -> (UInt16) -> () : @$s3Lib9PkgKlassZC3envs6UInt16Vvs // PkgKlassZ.env.setter -// CHECK-NEXT: #PkgKlassZ.env!modify: (PkgKlassZ) -> () -> () : @$s3Lib9PkgKlassZC3envs6UInt16VvM // PkgKlassZ.env.modify +// CHECK-NEXT: #PkgKlassZ.env!modify: (PkgKlassZ) -> @yield_once () -> inout @yields UInt16 : @$s3Lib9PkgKlassZC3envs6UInt16VvM // PkgKlassZ.env.modify // CHECK-NEXT: #PkgKlassZ.init!allocator: (PkgKlassZ.Type) -> (UInt16) -> PkgKlassZ : @$s3Lib9PkgKlassZC8rawValueACs6UInt16V_tcfC // PkgKlassZ.__allocating_init(rawValue:) // CHECK-NEXT: #PkgKlassZ.pkgFunc: (PkgKlassZ) -> () -> () : @$s3Lib9PkgKlassZC7pkgFuncyyF // PkgKlassZ.pkgFunc() // CHECK-NEXT: #PkgKlassZ.deinit!deallocator: @$s3Lib9PkgKlassZCfD // PkgKlassZ.__deallocating_deinit @@ -538,7 +538,7 @@ package func runPkg(_ arg: [any PkgProto]) { //CHECK-NEXT: method #PubProto.root!getter: (Self.Type) -> () -> UInt16 : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP4roots6UInt16VvgZTW //CHECK-NEXT: method #PubProto.env!getter: (Self) -> () -> UInt16 : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP3envs6UInt16VvgTW //CHECK-NEXT: method #PubProto.env!setter: (inout Self) -> (UInt16) -> () : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP3envs6UInt16VvsTW -//CHECK-NEXT: method #PubProto.env!modify: (inout Self) -> () -> () : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP3envs6UInt16VvMTW +//CHECK-NEXT: method #PubProto.env!modify: (inout Self) -> @yield_once () -> inout @yields UInt16 : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP3envs6UInt16VvMTW //CHECK-NEXT: method #PubProto.init!allocator: (Self.Type) -> (UInt16) -> Self : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP8rawValuexs6UInt16V_tcfCTW //CHECK-NEXT: method #PubProto.pubFunc: (Self) -> () -> () : @$s3Lib9PubKlassZCAA0B5ProtoA2aDP7pubFuncyyFTW @@ -547,14 +547,14 @@ package func runPkg(_ arg: [any PkgProto]) { //CHECK-NEXT: method #PubProto.root!getter: (Self.Type) -> () -> UInt16 : @$s3Lib9PubStructVAA0B5ProtoA2aDP4roots6UInt16VvgZTW //CHECK-NEXT: method #PubProto.env!getter: (Self) -> () -> UInt16 : @$s3Lib9PubStructVAA0B5ProtoA2aDP3envs6UInt16VvgTW //CHECK-NEXT: method #PubProto.env!setter: (inout Self) -> (UInt16) -> () : @$s3Lib9PubStructVAA0B5ProtoA2aDP3envs6UInt16VvsTW -//CHECK-NEXT: method #PubProto.env!modify: (inout Self) -> () -> () : @$s3Lib9PubStructVAA0B5ProtoA2aDP3envs6UInt16VvMTW +//CHECK-NEXT: method #PubProto.env!modify: (inout Self) -> @yield_once () -> inout @yields UInt16 : @$s3Lib9PubStructVAA0B5ProtoA2aDP3envs6UInt16VvMTW //CHECK-NEXT: method #PubProto.init!allocator: (Self.Type) -> (UInt16) -> Self : @$s3Lib9PubStructVAA0B5ProtoA2aDP8rawValuexs6UInt16V_tcfCTW //CHECK-NEXT: method #PubProto.pubFunc: (Self) -> () -> () : @$s3Lib9PubStructVAA0B5ProtoA2aDP7pubFuncyyFTW //CHECK-LABEL: sil_witness_table [serialized_for_package] PubStructX: PubSimpleProto module Lib { //CHECK-NEXT: method #PubSimpleProto.pubVar!getter: (Self) -> () -> Int : @$s3Lib10PubStructXVAA0B11SimpleProtoA2aDP6pubVarSivgTW //CHECK-NEXT: method #PubSimpleProto.pubVar!setter: (inout Self) -> (Int) -> () : @$s3Lib10PubStructXVAA0B11SimpleProtoA2aDP6pubVarSivsTW -//CHECK-NEXT: method #PubSimpleProto.pubVar!modify: (inout Self) -> () -> () : @$s3Lib10PubStructXVAA0B11SimpleProtoA2aDP6pubVarSivMTW +//CHECK-NEXT: method #PubSimpleProto.pubVar!modify: (inout Self) -> @yield_once () -> inout @yields Int : @$s3Lib10PubStructXVAA0B11SimpleProtoA2aDP6pubVarSivMTW //CHECK-NEXT: method #PubSimpleProto.pubFunc: (Self) -> () -> Int : @$s3Lib10PubStructXVAA0B11SimpleProtoA2aDP7pubFuncSiyFTW //CHECK-LABEL: sil_witness_table package [serialized_for_package] PkgKlassZ: PkgProto module Lib { @@ -562,7 +562,7 @@ package func runPkg(_ arg: [any PkgProto]) { //CHECK-NEXT: method #PkgProto.root!getter: (Self.Type) -> () -> UInt16 : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP4roots6UInt16VvgZTW //CHECK-NEXT: method #PkgProto.env!getter: (Self) -> () -> UInt16 : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP3envs6UInt16VvgTW //CHECK-NEXT: method #PkgProto.env!setter: (inout Self) -> (UInt16) -> () : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP3envs6UInt16VvsTW -//CHECK-NEXT: method #PkgProto.env!modify: (inout Self) -> () -> () : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP3envs6UInt16VvMTW +//CHECK-NEXT: method #PkgProto.env!modify: (inout Self) -> @yield_once () -> inout @yields UInt16 : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP3envs6UInt16VvMTW //CHECK-NEXT: method #PkgProto.init!allocator: (Self.Type) -> (UInt16) -> Self : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP8rawValuexs6UInt16V_tcfCTW //CHECK-NEXT: method #PkgProto.pkgFunc: (Self) -> () -> () : @$s3Lib9PkgKlassZCAA0B5ProtoA2aDP7pkgFuncyyFTW @@ -571,12 +571,12 @@ package func runPkg(_ arg: [any PkgProto]) { //CHECK-NEXT: method #PkgProto.root!getter: (Self.Type) -> () -> UInt16 : @$s3Lib9PkgStructVAA0B5ProtoA2aDP4roots6UInt16VvgZTW //CHECK-NEXT: method #PkgProto.env!getter: (Self) -> () -> UInt16 : @$s3Lib9PkgStructVAA0B5ProtoA2aDP3envs6UInt16VvgTW //CHECK-NEXT: method #PkgProto.env!setter: (inout Self) -> (UInt16) -> () : @$s3Lib9PkgStructVAA0B5ProtoA2aDP3envs6UInt16VvsTW -//CHECK-NEXT: method #PkgProto.env!modify: (inout Self) -> () -> () : @$s3Lib9PkgStructVAA0B5ProtoA2aDP3envs6UInt16VvMTW +//CHECK-NEXT: method #PkgProto.env!modify: (inout Self) -> @yield_once () -> inout @yields UInt16 : @$s3Lib9PkgStructVAA0B5ProtoA2aDP3envs6UInt16VvMTW //CHECK-NEXT: method #PkgProto.init!allocator: (Self.Type) -> (UInt16) -> Self : @$s3Lib9PkgStructVAA0B5ProtoA2aDP8rawValuexs6UInt16V_tcfCTW //CHECK-NEXT: method #PkgProto.pkgFunc: (Self) -> () -> () : @$s3Lib9PkgStructVAA0B5ProtoA2aDP7pkgFuncyyFTW //CHECK-LABEL: sil_witness_table package [serialized_for_package] PkgStructX: PkgSimpleProto module Lib { //CHECK-NEXT: method #PkgSimpleProto.pkgVar!getter: (Self) -> () -> Int : @$s3Lib10PkgStructXVAA0B11SimpleProtoA2aDP6pkgVarSivgTW //CHECK-NEXT: method #PkgSimpleProto.pkgVar!setter: (inout Self) -> (Int) -> () : @$s3Lib10PkgStructXVAA0B11SimpleProtoA2aDP6pkgVarSivsTW -//CHECK-NEXT: method #PkgSimpleProto.pkgVar!modify: (inout Self) -> () -> () : @$s3Lib10PkgStructXVAA0B11SimpleProtoA2aDP6pkgVarSivMTW +//CHECK-NEXT: method #PkgSimpleProto.pkgVar!modify: (inout Self) -> @yield_once () -> inout @yields Int : @$s3Lib10PkgStructXVAA0B11SimpleProtoA2aDP6pkgVarSivMTW //CHECK-NEXT: method #PkgSimpleProto.pkgFunc: (Self) -> () -> Int : @$s3Lib10PkgStructXVAA0B11SimpleProtoA2aDP7pkgFuncSiyFTW diff --git a/test/SILOptimizer/simplify_begin_apply.sil b/test/SILOptimizer/simplify_begin_apply.sil index 33d5bf6aebe92..e879dc1cebc7f 100644 --- a/test/SILOptimizer/simplify_begin_apply.sil +++ b/test/SILOptimizer/simplify_begin_apply.sil @@ -20,7 +20,7 @@ class Bar { sil @devirt_class_method : $@convention(thin) () -> (Int, @error any Error) { bb0: %0 = alloc_ref $Bar - %1 = class_method %0 : $Bar, #Bar.field!read : (Bar) -> () -> (), $@yield_once @convention(method) (@guaranteed Bar) -> @yields Int + %1 = class_method %0 : $Bar, #Bar.field!read : (Bar) -> @yield_once () -> @yields Int, $@yield_once @convention(method) (@guaranteed Bar) -> @yields Int (%2, %3) = begin_apply %1(%0) : $@yield_once @convention(method) (@guaranteed Bar) -> @yields Int end_apply %3 as $() return %2 : $Int diff --git a/test/SILOptimizer/specialize_opaque_result_types.sil b/test/SILOptimizer/specialize_opaque_result_types.sil index c828944d417ae..cb91e83ca9df0 100644 --- a/test/SILOptimizer/specialize_opaque_result_types.sil +++ b/test/SILOptimizer/specialize_opaque_result_types.sil @@ -53,7 +53,7 @@ bb0(%0 : $*Optional<τ_0_0.Element>, %1 : $*IndexingIterator<τ_0_0>): copy_addr %3 to [init] %22 : $*τ_0_0.Index %24 = alloc_stack $τ_0_0 copy_addr [take] %20 to [init] %24 : $*τ_0_0 - %26 = witness_method $τ_0_0, #Collection.subscript!read : (Self) -> (Self.Index) -> () : $@yield_once @convention(witness_method: Collection) <τ_0_0 where τ_0_0 : Collection> (@in_guaranteed τ_0_0.Index, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element + %26 = witness_method $τ_0_0, #Collection.subscript!read : (Self) -> @yield_once (Self.Index) -> @yields Self.Element : $@yield_once @convention(witness_method: Collection) <τ_0_0 where τ_0_0 : Collection> (@in_guaranteed τ_0_0.Index, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // The specialized begin apply %26 has a result type of t_0_0.Element // which works out to be an opaque result type whose underlying type is Int64. diff --git a/test/SILOptimizer/specialize_opaque_result_types_ossa.sil b/test/SILOptimizer/specialize_opaque_result_types_ossa.sil index 55199064e16e1..de5b72fd9e528 100644 --- a/test/SILOptimizer/specialize_opaque_result_types_ossa.sil +++ b/test/SILOptimizer/specialize_opaque_result_types_ossa.sil @@ -52,7 +52,7 @@ bb0(%0 : $*Optional<τ_0_0.Element>, %1 : $*IndexingIterator<τ_0_0>): copy_addr %3 to [init] %22 : $*τ_0_0.Index %24 = alloc_stack $τ_0_0 copy_addr [take] %20 to [init] %24 : $*τ_0_0 - %26 = witness_method $τ_0_0, #Collection.subscript!read : (Self) -> (Self.Index) -> () : $@yield_once @convention(witness_method: Collection) <τ_0_0 where τ_0_0 : Collection> (@in_guaranteed τ_0_0.Index, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element + %26 = witness_method $τ_0_0, #Collection.subscript!read : (Self) -> @yield_once (Self.Index) -> @yields Self.Element : $@yield_once @convention(witness_method: Collection) <τ_0_0 where τ_0_0 : Collection> (@in_guaranteed τ_0_0.Index, @in_guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element // The specialized begin apply %26 has a result type of t_0_0.Element // which works out to be an opaque result type whose underlying type is Int64. diff --git a/test/api-digester/Inputs/stability-stdlib-abi-without-asserts-arm64.txt b/test/api-digester/Inputs/stability-stdlib-abi-without-asserts-arm64.txt index 38664f1fe1785..4dfda79fcf676 100644 --- a/test/api-digester/Inputs/stability-stdlib-abi-without-asserts-arm64.txt +++ b/test/api-digester/Inputs/stability-stdlib-abi-without-asserts-arm64.txt @@ -3,8 +3,11 @@ Accessor __VaListBuilder.storage.Get() has mangled name changing from 'Swift.__VaListBuilder.storage.getter : Swift.ContiguousArray' to 'Swift.__VaListBuilder.storage.getter : Swift.Optional>' Accessor __VaListBuilder.storage.Get() has return type change from Swift.ContiguousArray to Swift.UnsafeMutablePointer? Accessor __VaListBuilder.storage.Modify() has mangled name changing from 'Swift.__VaListBuilder.storage.modify : Swift.ContiguousArray' to 'Swift.__VaListBuilder.storage.modify : Swift.Optional>' +Accessor __VaListBuilder.storage.Modify() has return type change from () to inout @yields Swift.UnsafeMutablePointer? Accessor __VaListBuilder.storage.Set() has mangled name changing from 'Swift.__VaListBuilder.storage.setter : Swift.ContiguousArray' to 'Swift.__VaListBuilder.storage.setter : Swift.Optional>' Accessor __VaListBuilder.storage.Set() has parameter 0 type change from Swift.ContiguousArray to Swift.UnsafeMutablePointer? +Accessor _fastEnumerationStorageMutationsTarget.Modify() has return type change from () to inout @yields Swift.UInt +Accessor _playgroundPrintHook.Modify() has return type change from () to inout @yields ((Swift.String) -> ())? Constructor BinaryFloatingPoint.init(_:) has been removed Constructor Double.init(_:) has mangled name changing from 'Swift.Double.init(Swift.Float80) -> Swift.Double' to 'Swift.Double.init(Swift.Float16) -> Swift.Double' Constructor Double.init(_:) has parameter 0 type change from Swift.Float80 to Swift.Float16 diff --git a/test/api-digester/Outputs/dump-module/cake-abi.json b/test/api-digester/Outputs/dump-module/cake-abi.json index 3dc45f9312fce..fb294c5c1e203 100644 --- a/test/api-digester/Outputs/dump-module/cake-abi.json +++ b/test/api-digester/Outputs/dump-module/cake-abi.json @@ -472,8 +472,8 @@ "children": [ { "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "YieldResult", + "printedName": "inout @yields cake.C1?" } ], "declKind": "Accessor", @@ -568,8 +568,8 @@ "children": [ { "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "YieldResult", + "printedName": "inout @yields cake.C1" } ], "declKind": "Accessor", @@ -974,8 +974,8 @@ "children": [ { "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "YieldResult", + "printedName": "inout @yields Swift.Int" } ], "declKind": "Accessor", @@ -1355,8 +1355,8 @@ "children": [ { "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "YieldResult", + "printedName": "inout @yields Swift.Int" }, { "kind": "TypeNominal", diff --git a/test/api-digester/stability-concurrency-abi.test b/test/api-digester/stability-concurrency-abi.test index 8e8e24505f24f..f92f23d1e1456 100644 --- a/test/api-digester/stability-concurrency-abi.test +++ b/test/api-digester/stability-concurrency-abi.test @@ -130,6 +130,44 @@ Func withTaskGroup(of:returning:body:) has mangled name changing from '_Concurre Func pthread_main_np() is a new API without '@available' +Accessor AsyncCompactMapSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncDropFirstSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncDropFirstSequence.Iterator.count.Modify() has return type change from () to inout @yields Swift.Int +Accessor AsyncDropWhileSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncDropWhileSequence.Iterator.predicate.Modify() has return type change from () to inout @yields ((τ_0_0.Element) async -> Swift.Bool)? +Accessor AsyncFilterSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncFlatMapSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncFlatMapSequence.Iterator.currentIterator.Modify() has return type change from () to inout @yields τ_0_1.AsyncIterator? +Accessor AsyncFlatMapSequence.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncMapSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncPrefixSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncPrefixSequence.Iterator.remaining.Modify() has return type change from () to inout @yields Swift.Int +Accessor AsyncPrefixWhileSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncPrefixWhileSequence.Iterator.predicateHasFailed.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncStream.Continuation.onTermination.Modify() has return type change from () to inout @yields ((_Concurrency.AsyncStream<τ_0_0>.Continuation.Termination) -> ())? +Accessor AsyncThrowingCompactMapSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncThrowingCompactMapSequence.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingDropWhileSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncThrowingDropWhileSequence.Iterator.doneDropping.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingDropWhileSequence.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingFilterSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncThrowingFilterSequence.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingFlatMapSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncThrowingFlatMapSequence.Iterator.currentIterator.Modify() has return type change from () to inout @yields τ_0_1.AsyncIterator? +Accessor AsyncThrowingFlatMapSequence.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingMapSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncThrowingMapSequence.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingPrefixWhileSequence.Iterator.baseIterator.Modify() has return type change from () to inout @yields τ_0_0.AsyncIterator +Accessor AsyncThrowingPrefixWhileSequence.Iterator.predicateHasFailed.Modify() has return type change from () to inout @yields Swift.Bool +Accessor AsyncThrowingStream.Continuation.onTermination.Modify() has return type change from () to inout @yields ((_Concurrency.AsyncThrowingStream<τ_0_0, τ_0_1>.Continuation.Termination) -> ())? +Accessor TaskGroup.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor TaskGroup.Iterator.group.Modify() has return type change from () to inout @yields _Concurrency.TaskGroup<τ_0_0> +Accessor TaskPriority.rawValue.Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor ThrowingTaskGroup.Iterator.finished.Modify() has return type change from () to inout @yields Swift.Bool +Accessor ThrowingTaskGroup.Iterator.group.Modify() has return type change from () to inout @yields _Concurrency.ThrowingTaskGroup<τ_0_0, τ_0_1> +Accessor UnownedSerialExecutor.executor.Modify() has return type change from () to inout @yields Builtin.Executor +Accessor UnsafeContinuation.context.Modify() has return type change from () to inout @yields Builtin.RawUnsafeContinuation + // *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.) diff --git a/test/api-digester/stability-stdlib-abi-without-asserts.test b/test/api-digester/stability-stdlib-abi-without-asserts.test index 746a95b2fe3bd..817f151699638 100644 --- a/test/api-digester/stability-stdlib-abi-without-asserts.test +++ b/test/api-digester/stability-stdlib-abi-without-asserts.test @@ -165,9 +165,13 @@ Func ContiguousArray._createNewBuffer(bufferIsUnique:minimumCapacity:growForAppe Func ContiguousArray._reserveCapacityImpl(minimumCapacity:growForAppend:) has been renamed to Func __specialize_class__reserveCapacityImpl(minimumCapacity:growForAppend:) Func ContiguousArray._reserveCapacityImpl(minimumCapacity:growForAppend:) has mangled name changing from 'Swift.ContiguousArray._reserveCapacityImpl(minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()' to 'Swift.ContiguousArray.__specialize_class__reserveCapacityImpl(minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()' -// This hasn't actually been changed, but it seems the ABI checker gives a false positive here and detects -// it as a removal with the addition of the RangeSet subscripts -Subscript MutableCollection.subscript(_:) has been removed +Subscript MutableCollection.subscript(_:) has generic signature change from to +Subscript MutableCollection.subscript(_:) has generic signature change from to +Subscript MutableCollection.subscript(_:) has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript(Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript(A1) -> A.SubSequence' +Subscript MutableCollection.subscript(_:) has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript(A1) -> A.SubSequence' to '(extension in Swift):Swift.MutableCollection.subscript((Swift.UnboundedRange_) -> ()) -> A.SubSequence' +Subscript MutableCollection.subscript(_:) has parameter 0 type change from Swift.Range<τ_0_0.Index> to τ_1_0 +Subscript MutableCollection.subscript(_:) has parameter 0 type change from τ_1_0 to (Swift.UnboundedRange_) -> () +Subscript MutableCollection.subscript(_:) has return type change from Swift.Slice<τ_0_0> to τ_0_0.SubSequence Protocol SIMDScalar has added inherited protocol BitwiseCopyable Protocol SIMDScalar has generic signature change from to @@ -366,6 +370,177 @@ Protocol _UnicodeParser has added inherited protocol Escapable Protocol __DefaultCustomPlaygroundQuickLookable has added inherited protocol Copyable Protocol __DefaultCustomPlaygroundQuickLookable has added inherited protocol Escapable +Accessor AnyIndex._box.Modify() has return type change from () to inout @yields any Swift._AnyIndexBox +Accessor Array._buffer.Modify() has return type change from () to inout @yields Swift._ArrayBuffer<τ_0_0> +Accessor Array.subscript(_:).Modify() has return type change from () to inout @yields Swift.ArraySlice<τ_0_0> +Accessor Array.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor ArraySlice._buffer.Modify() has return type change from () to inout @yields Swift._SliceBuffer<τ_0_0> +Accessor ArraySlice.subscript(_:).Modify() has return type change from () to inout @yields Swift.ArraySlice<τ_0_0> +Accessor ArraySlice.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor AutoreleasingUnsafeMutablePointer.pointee.Modify() has return type change from () to inout @yields τ_0_0 +Accessor BidirectionalCollection.subscript(_:).Read() has return type change from () to @yields τ_0_0.Element +Accessor Bool._value.Modify() has return type change from () to inout @yields Builtin.Int1 +Accessor CVaListPointer._value.Modify() has return type change from () to inout @yields Swift.UnsafeMutableRawPointer +Accessor Character._str.Modify() has return type change from () to inout @yields Swift.String +Accessor Collection.subscript(_:).Read() has return type change from () to @yields τ_0_0.Element +Accessor CollectionOfOne.Iterator._elements.Modify() has return type change from () to inout @yields τ_0_0? +Accessor CollectionOfOne._element.Modify() has return type change from () to inout @yields τ_0_0 +Accessor CollectionOfOne.subscript(_:).Modify() has return type change from () to inout @yields Swift.Slice> +Accessor CollectionOfOne.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor CommandLine._argc.Modify() has return type change from () to inout @yields Swift.Int32 +Accessor CommandLine._unsafeArgv.Modify() has return type change from () to inout @yields Swift.UnsafeMutablePointer?> +Accessor CommandLine.arguments.Modify() has return type change from () to inout @yields [Swift.String] +Accessor ContiguousArray._buffer.Modify() has return type change from () to inout @yields Swift._ContiguousArrayBuffer<τ_0_0> +Accessor ContiguousArray.subscript(_:).Modify() has return type change from () to inout @yields Swift.ArraySlice<τ_0_0> +Accessor ContiguousArray.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor DefaultIndices._elements.Modify() has return type change from () to inout @yields τ_0_0 +Accessor DefaultIndices._endIndex.Modify() has return type change from () to inout @yields τ_0_0.Index +Accessor DefaultIndices._startIndex.Modify() has return type change from () to inout @yields τ_0_0.Index +Accessor DefaultStringInterpolation._storage.Modify() has return type change from () to inout @yields Swift.String +Accessor Dictionary.Index._asCocoa.Modify() has return type change from () to inout @yields Swift.__CocoaDictionary.Index +Accessor Dictionary.Index._variant.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>.Index._Variant +Accessor Dictionary.Iterator._asNative.Modify() has return type change from () to inout @yields Swift._NativeDictionary<τ_0_0, τ_0_1>.Iterator +Accessor Dictionary.Iterator._variant.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>.Iterator._Variant +Accessor Dictionary.Keys.Iterator._base.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>.Iterator +Accessor Dictionary.Keys._variant.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>._Variant +Accessor Dictionary.Values.Iterator._base.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>.Iterator +Accessor Dictionary.Values._variant.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>._Variant +Accessor Dictionary.Values.subscript(_:).Modify() has return type change from () to inout @yields τ_0_1 +Accessor Dictionary._Variant.asNative.Modify() has return type change from () to inout @yields Swift._NativeDictionary<τ_0_0, τ_0_1> +Accessor Dictionary._Variant.object.Modify() has return type change from () to inout @yields Swift._BridgeStorage +Accessor Dictionary._Variant.subscript(_:).Modify() has return type change from () to inout @yields τ_0_1? +Accessor Dictionary._variant.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>._Variant +Accessor Dictionary.subscript(_:).Modify() has return type change from () to inout @yields τ_0_1? +Accessor Dictionary.subscript(_:default:).Modify() has return type change from () to inout @yields τ_0_1 +Accessor Dictionary.values.Modify() has return type change from () to inout @yields Swift.Dictionary<τ_0_0, τ_0_1>.Values +Accessor Double.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xFPIEEE64 +Accessor Double.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Double +Accessor Double.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xFPIEEE64 +Accessor Double.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Double +Accessor Double.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xFPIEEE64 +Accessor Double.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Double +Accessor Double.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xFPIEEE64 +Accessor Double.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Double +Accessor Double.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xFPIEEE64 +Accessor Double.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Double +Accessor Double.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xFPIEEE64 +Accessor Double.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Double +Accessor Double._value.Modify() has return type change from () to inout @yields Builtin.FPIEEE64 +Accessor DropWhileSequence.Iterator._iterator.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor DropWhileSequence.Iterator._nextElement.Modify() has return type change from () to inout @yields τ_0_0.Element? +Accessor DropWhileSequence._iterator.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor DropWhileSequence._nextElement.Modify() has return type change from () to inout @yields τ_0_0.Element? +Accessor EmptyCollection.subscript(_:).Modify() has return type change from () to inout @yields Swift.EmptyCollection<τ_0_0> +Accessor EmptyCollection.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor EnumeratedSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor EnumeratedSequence.Iterator._count.Modify() has return type change from () to inout @yields Swift.Int +Accessor EnumeratedSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor FlattenSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor FlattenSequence.Iterator._inner.Modify() has return type change from () to inout @yields τ_0_0.Element.Iterator? +Accessor FlattenSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor Float.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xFPIEEE32 +Accessor Float.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Float +Accessor Float.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xFPIEEE32 +Accessor Float.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Float +Accessor Float.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xFPIEEE32 +Accessor Float.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Float +Accessor Float.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xFPIEEE32 +Accessor Float.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Float +Accessor Float.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xFPIEEE32 +Accessor Float.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Float +Accessor Float.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xFPIEEE32 +Accessor Float.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Float +Accessor Float._value.Modify() has return type change from () to inout @yields Builtin.FPIEEE32 +Accessor IndexingIterator._position.Modify() has return type change from () to inout @yields τ_0_0.Index +Accessor Int.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt64 +Accessor Int.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int +Accessor Int.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt64 +Accessor Int.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int +Accessor Int.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt64 +Accessor Int.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int +Accessor Int.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt64 +Accessor Int.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int +Accessor Int.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt64 +Accessor Int.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int +Accessor Int.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt64 +Accessor Int.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int +Accessor Int.Words._value.Modify() has return type change from () to inout @yields Swift.Int +Accessor Int._value.Modify() has return type change from () to inout @yields Builtin.Int64 +Accessor Int16.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt16 +Accessor Int16.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt16 +Accessor Int16.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt16 +Accessor Int16.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt16 +Accessor Int16.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt16 +Accessor Int16.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt16 +Accessor Int16.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16.Words._value.Modify() has return type change from () to inout @yields Swift.Int16 +Accessor Int16._value.Modify() has return type change from () to inout @yields Builtin.Int16 +Accessor Int32.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt32 +Accessor Int32.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt32 +Accessor Int32.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt32 +Accessor Int32.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt32 +Accessor Int32.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt32 +Accessor Int32.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt32 +Accessor Int32.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32.Words._value.Modify() has return type change from () to inout @yields Swift.Int32 +Accessor Int32._value.Modify() has return type change from () to inout @yields Builtin.Int32 +Accessor Int64.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt64 +Accessor Int64.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt64 +Accessor Int64.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt64 +Accessor Int64.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt64 +Accessor Int64.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt64 +Accessor Int64.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt64 +Accessor Int64.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64.Words._value.Modify() has return type change from () to inout @yields Swift.Int64 +Accessor Int64._value.Modify() has return type change from () to inout @yields Builtin.Int64 +Accessor Int8.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt8 +Accessor Int8.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt8 +Accessor Int8.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt8 +Accessor Int8.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt8 +Accessor Int8.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt8 +Accessor Int8.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt8 +Accessor Int8.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8.Words._value.Modify() has return type change from () to inout @yields Swift.Int8 +Accessor Int8._value.Modify() has return type change from () to inout @yields Builtin.Int8 +Accessor IteratorSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor JoinedSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor JoinedSequence.Iterator._inner.Modify() has return type change from () to inout @yields τ_0_0.Element.Iterator? +Accessor JoinedSequence.Iterator._separator.Modify() has return type change from () to inout @yields Swift.IndexingIterator>? +Accessor JoinedSequence.Iterator._separatorData.Modify() has return type change from () to inout @yields Swift.ContiguousArray<τ_0_0.Element.Element> +Accessor JoinedSequence.Iterator._state.Modify() has return type change from () to inout @yields Swift.JoinedSequence<τ_0_0>.Iterator._JoinIteratorState +Accessor JoinedSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor JoinedSequence._separator.Modify() has return type change from () to inout @yields Swift.ContiguousArray<τ_0_0.Element.Element> +Accessor LazyDropWhileSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor LazyDropWhileSequence.Iterator._predicateHasFailed.Modify() has return type change from () to inout @yields Swift.Bool +Accessor LazyDropWhileSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor LazyFilterSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor LazyFilterSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor LazyMapSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor LazyMapSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor LazyPrefixWhileSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor LazyPrefixWhileSequence.Iterator._predicateHasFailed.Modify() has return type change from () to inout @yields Swift.Bool +Accessor LazyPrefixWhileSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor LazySequence._base.Modify() has return type change from () to inout @yields τ_0_0 Accessor ManagedBuffer.capacity.Get() has generic signature change from to Accessor ManagedBuffer.capacity.Get() has mangled name changing from 'Swift.ManagedBuffer.capacity.getter : Swift.Int' to '(extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.capacity.getter : Swift.Int' Accessor ManagedBuffer.firstElementAddress.Get() has generic signature change from to @@ -374,6 +549,7 @@ Accessor ManagedBuffer.header.Get() has generic signature change from .header.getter : A' Accessor ManagedBuffer.header.Modify() has generic signature change from to Accessor ManagedBuffer.header.Modify() has mangled name changing from 'Swift.ManagedBuffer.header.modify : A' to '(extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.header.modify : A' +Accessor ManagedBuffer.header.Modify() has return type change from () to inout @yields τ_0_0 Accessor ManagedBuffer.header.Set() has generic signature change from to Accessor ManagedBuffer.header.Set() has mangled name changing from 'Swift.ManagedBuffer.header.setter : A' to '(extension in Swift):Swift.ManagedBuffer< where B: ~Swift.Copyable>.header.setter : A' Accessor ManagedBuffer.headerAddress.Get() has generic signature change from to @@ -396,6 +572,7 @@ Accessor ManagedBufferPointer._nativeBuffer.Get() has generic signature change f Accessor ManagedBufferPointer._nativeBuffer.Get() has mangled name changing from 'Swift.ManagedBufferPointer._nativeBuffer.getter : Builtin.NativeObject' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>._nativeBuffer.getter : Builtin.NativeObject' Accessor ManagedBufferPointer._nativeBuffer.Modify() has generic signature change from to Accessor ManagedBufferPointer._nativeBuffer.Modify() has mangled name changing from 'Swift.ManagedBufferPointer._nativeBuffer.modify : Builtin.NativeObject' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>._nativeBuffer.modify : Builtin.NativeObject' +Accessor ManagedBufferPointer._nativeBuffer.Modify() has return type change from () to inout @yields Builtin.NativeObject Accessor ManagedBufferPointer._nativeBuffer.Set() has generic signature change from to Accessor ManagedBufferPointer._nativeBuffer.Set() has mangled name changing from 'Swift.ManagedBufferPointer._nativeBuffer.setter : Builtin.NativeObject' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>._nativeBuffer.setter : Builtin.NativeObject' Accessor ManagedBufferPointer.buffer.Get() has generic signature change from to @@ -406,6 +583,7 @@ Accessor ManagedBufferPointer.header.Get() has generic signature change from .header.getter : A' Accessor ManagedBufferPointer.header.Modify() has generic signature change from to Accessor ManagedBufferPointer.header.Modify() has mangled name changing from 'Swift.ManagedBufferPointer.header.modify : A' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>.header.modify : A' +Accessor ManagedBufferPointer.header.Modify() has return type change from () to inout @yields τ_0_0 Accessor ManagedBufferPointer.header.Set() has generic signature change from to Accessor ManagedBufferPointer.header.Set() has mangled name changing from 'Swift.ManagedBufferPointer.header.setter : A' to '(extension in Swift):Swift.ManagedBufferPointer< where B: ~Swift.Copyable>.header.setter : A' Accessor MemoryLayout.alignment.Get() has generic signature change from to @@ -414,6 +592,207 @@ Accessor MemoryLayout.size.Get() has generic signature change from to .size.getter : Swift.Int' Accessor MemoryLayout.stride.Get() has generic signature change from to Accessor MemoryLayout.stride.Get() has mangled name changing from 'static Swift.MemoryLayout.stride.getter : Swift.Int' to 'static (extension in Swift):Swift.MemoryLayout< where A: ~Swift.Copyable, A: ~Swift.Escapable>.stride.getter : Swift.Int' +Accessor MutableCollection.subscript(_:).Get() has generic signature change from to +Accessor MutableCollection.subscript(_:).Get() has generic signature change from to +Accessor MutableCollection.subscript(_:).Get() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.getter : (A1) -> A.SubSequence' +Accessor MutableCollection.subscript(_:).Get() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.getter : (A1) -> A.SubSequence' to '(extension in Swift):Swift.MutableCollection.subscript.getter : ((Swift.UnboundedRange_) -> ()) -> A.SubSequence' +Accessor MutableCollection.subscript(_:).Get() has parameter 0 type change from Swift.Range<τ_0_0.Index> to τ_1_0 +Accessor MutableCollection.subscript(_:).Get() has parameter 0 type change from τ_1_0 to (Swift.UnboundedRange_) -> () +Accessor MutableCollection.subscript(_:).Get() has return type change from Swift.Slice<τ_0_0> to τ_0_0.SubSequence +Accessor MutableCollection.subscript(_:).Modify() has generic signature change from to +Accessor MutableCollection.subscript(_:).Modify() has generic signature change from to +Accessor MutableCollection.subscript(_:).Modify() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.modify : (A1) -> A.SubSequence' +Accessor MutableCollection.subscript(_:).Modify() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.modify : (A1) -> A.SubSequence' to '(extension in Swift):Swift.MutableCollection.subscript.modify : ((Swift.UnboundedRange_) -> ()) -> A.SubSequence' +Accessor MutableCollection.subscript(_:).Modify() has parameter 0 type change from Swift.Range<τ_0_0.Index> to τ_1_0 +Accessor MutableCollection.subscript(_:).Modify() has parameter 0 type change from τ_1_0 to (Swift.UnboundedRange_) -> () +Accessor MutableCollection.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0.Element +Accessor MutableCollection.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0.SubSequence +Accessor MutableCollection.subscript(_:).Read() has return type change from () to @yields τ_0_0.Element +Accessor MutableCollection.subscript(_:).Set() has generic signature change from to +Accessor MutableCollection.subscript(_:).Set() has generic signature change from to +Accessor MutableCollection.subscript(_:).Set() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.setter : (A1) -> A.SubSequence' +Accessor MutableCollection.subscript(_:).Set() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.setter : (A1) -> A.SubSequence' to '(extension in Swift):Swift.MutableCollection.subscript.setter : ((Swift.UnboundedRange_) -> ()) -> A.SubSequence' +Accessor MutableCollection.subscript(_:).Set() has parameter 0 type change from Swift.Slice<τ_0_0> to τ_0_0.SubSequence +Accessor MutableCollection.subscript(_:).Set() has parameter 1 type change from Swift.Range<τ_0_0.Index> to τ_1_0 +Accessor MutableCollection.subscript(_:).Set() has parameter 1 type change from τ_1_0 to (Swift.UnboundedRange_) -> () +Accessor OpaquePointer._rawValue.Modify() has return type change from () to inout @yields Builtin.RawPointer +Accessor PartialRangeFrom.Iterator._current.Modify() has return type change from () to inout @yields τ_0_0 +Accessor PrefixSequence.Iterator._base.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor PrefixSequence.Iterator._remaining.Modify() has return type change from () to inout @yields Swift.Int +Accessor PrefixSequence._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor RandomAccessCollection.subscript(_:).Read() has return type change from () to @yields τ_0_0.Element +Accessor RangeReplaceableCollection.subscript(_:).Read() has return type change from () to @yields τ_0_0.Element +Accessor ReversedCollection.Iterator._position.Modify() has return type change from () to inout @yields τ_0_0.Index +Accessor SIMD16._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD16Storage +Accessor SIMD16.evenHalf.Modify() has return type change from () to inout @yields Swift.SIMD8<τ_0_0> +Accessor SIMD16.highHalf.Modify() has return type change from () to inout @yields Swift.SIMD8<τ_0_0> +Accessor SIMD16.lowHalf.Modify() has return type change from () to inout @yields Swift.SIMD8<τ_0_0> +Accessor SIMD16.oddHalf.Modify() has return type change from () to inout @yields Swift.SIMD8<τ_0_0> +Accessor SIMD16.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD2._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD2Storage +Accessor SIMD2.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD2.x.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD2.y.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD3._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD4Storage +Accessor SIMD3.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD3.x.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD3.y.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD3.z.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD32._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD32Storage +Accessor SIMD32.evenHalf.Modify() has return type change from () to inout @yields Swift.SIMD16<τ_0_0> +Accessor SIMD32.highHalf.Modify() has return type change from () to inout @yields Swift.SIMD16<τ_0_0> +Accessor SIMD32.lowHalf.Modify() has return type change from () to inout @yields Swift.SIMD16<τ_0_0> +Accessor SIMD32.oddHalf.Modify() has return type change from () to inout @yields Swift.SIMD16<τ_0_0> +Accessor SIMD32.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD4._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD4Storage +Accessor SIMD4.evenHalf.Modify() has return type change from () to inout @yields Swift.SIMD2<τ_0_0> +Accessor SIMD4.highHalf.Modify() has return type change from () to inout @yields Swift.SIMD2<τ_0_0> +Accessor SIMD4.lowHalf.Modify() has return type change from () to inout @yields Swift.SIMD2<τ_0_0> +Accessor SIMD4.oddHalf.Modify() has return type change from () to inout @yields Swift.SIMD2<τ_0_0> +Accessor SIMD4.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD4.w.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD4.x.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD4.y.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD4.z.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD64._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD64Storage +Accessor SIMD64.evenHalf.Modify() has return type change from () to inout @yields Swift.SIMD32<τ_0_0> +Accessor SIMD64.highHalf.Modify() has return type change from () to inout @yields Swift.SIMD32<τ_0_0> +Accessor SIMD64.lowHalf.Modify() has return type change from () to inout @yields Swift.SIMD32<τ_0_0> +Accessor SIMD64.oddHalf.Modify() has return type change from () to inout @yields Swift.SIMD32<τ_0_0> +Accessor SIMD64.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMD8._storage.Modify() has return type change from () to inout @yields τ_0_0.SIMD8Storage +Accessor SIMD8.evenHalf.Modify() has return type change from () to inout @yields Swift.SIMD4<τ_0_0> +Accessor SIMD8.highHalf.Modify() has return type change from () to inout @yields Swift.SIMD4<τ_0_0> +Accessor SIMD8.lowHalf.Modify() has return type change from () to inout @yields Swift.SIMD4<τ_0_0> +Accessor SIMD8.oddHalf.Modify() has return type change from () to inout @yields Swift.SIMD4<τ_0_0> +Accessor SIMD8.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMDMask._storage.Modify() has return type change from () to inout @yields τ_0_0 +Accessor SIMDMask.subscript(_:).Modify() has return type change from () to inout @yields Swift.Bool +Accessor SIMDStorage.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0.Scalar +Accessor Set.Index._asCocoa.Modify() has return type change from () to inout @yields Swift.__CocoaSet.Index +Accessor Set.Index._variant.Modify() has return type change from () to inout @yields Swift.Set<τ_0_0>.Index._Variant +Accessor Set.Iterator._asNative.Modify() has return type change from () to inout @yields Swift._NativeSet<τ_0_0>.Iterator +Accessor Set.Iterator._variant.Modify() has return type change from () to inout @yields Swift.Set<τ_0_0>.Iterator._Variant +Accessor Set._Variant.asNative.Modify() has return type change from () to inout @yields Swift._NativeSet<τ_0_0> +Accessor Set._Variant.object.Modify() has return type change from () to inout @yields Swift._BridgeStorage +Accessor Set._variant.Modify() has return type change from () to inout @yields Swift.Set<τ_0_0>._Variant +Accessor Slice._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor Slice._endIndex.Modify() has return type change from () to inout @yields τ_0_0.Index +Accessor Slice._startIndex.Modify() has return type change from () to inout @yields τ_0_0.Index +Accessor Slice.subscript(_:).Modify() has return type change from () to inout @yields Swift.Slice<τ_0_0> +Accessor Slice.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0.Element +Accessor StaticString._flags.Modify() has return type change from () to inout @yields Builtin.Int8 +Accessor StaticString._startPtrOrData.Modify() has return type change from () to inout @yields Builtin.Word +Accessor StaticString._utf8CodeUnitCount.Modify() has return type change from () to inout @yields Builtin.Word +Accessor StrideThroughIterator._current.Modify() has return type change from () to inout @yields (index: Swift.Int?, value: τ_0_0) +Accessor StrideThroughIterator._didReturnEnd.Modify() has return type change from () to inout @yields Swift.Bool +Accessor StrideToIterator._current.Modify() has return type change from () to inout @yields (index: Swift.Int?, value: τ_0_0) +Accessor String.Index._rawBits.Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor String.Iterator._end.Modify() has return type change from () to inout @yields Swift.Int +Accessor String.Iterator._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String.Iterator._position.Modify() has return type change from () to inout @yields Swift.Int +Accessor String.UTF16View.Iterator._end.Modify() has return type change from () to inout @yields Swift.Int +Accessor String.UTF16View.Iterator._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String.UTF16View.Iterator._nextIsTrailingSurrogate.Modify() has return type change from () to inout @yields Swift.UInt16? +Accessor String.UTF16View.Iterator._position.Modify() has return type change from () to inout @yields Swift.Int +Accessor String.UTF16View._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String.UTF8View._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String.UnicodeScalarView.Iterator._end.Modify() has return type change from () to inout @yields Swift.Int +Accessor String.UnicodeScalarView.Iterator._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String.UnicodeScalarView.Iterator._position.Modify() has return type change from () to inout @yields Swift.Int +Accessor String.UnicodeScalarView._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String._guts.Modify() has return type change from () to inout @yields Swift._StringGuts +Accessor String.unicodeScalars.Modify() has return type change from () to inout @yields Swift.String.UnicodeScalarView +Accessor String.utf16.Modify() has return type change from () to inout @yields Swift.String.UTF16View +Accessor String.utf8.Modify() has return type change from () to inout @yields Swift.String.UTF8View +Accessor Substring.UTF16View._slice.Modify() has return type change from () to inout @yields Swift.Slice +Accessor Substring.UTF8View._slice.Modify() has return type change from () to inout @yields Swift.Slice +Accessor Substring.UnicodeScalarView._slice.Modify() has return type change from () to inout @yields Swift.Slice +Accessor Substring._slice.Modify() has return type change from () to inout @yields Swift.Slice +Accessor Substring.unicodeScalars.Modify() has return type change from () to inout @yields Swift.Substring.UnicodeScalarView +Accessor Substring.utf16.Modify() has return type change from () to inout @yields Swift.Substring.UTF16View +Accessor Substring.utf8.Modify() has return type change from () to inout @yields Swift.Substring.UTF8View +Accessor UInt.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt64 +Accessor UInt.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt64 +Accessor UInt.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt64 +Accessor UInt.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt64 +Accessor UInt.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt64 +Accessor UInt.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt64 +Accessor UInt.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt.Words._value.Modify() has return type change from () to inout @yields Swift.UInt +Accessor UInt._value.Modify() has return type change from () to inout @yields Builtin.Int64 +Accessor UInt16.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt16 +Accessor UInt16.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt16 +Accessor UInt16.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt16 +Accessor UInt16.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt16 +Accessor UInt16.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt16 +Accessor UInt16.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt16 +Accessor UInt16.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16.Words._value.Modify() has return type change from () to inout @yields Swift.UInt16 +Accessor UInt16._value.Modify() has return type change from () to inout @yields Builtin.Int16 +Accessor UInt32.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt32 +Accessor UInt32.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt32 +Accessor UInt32.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt32 +Accessor UInt32.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt32 +Accessor UInt32.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt32 +Accessor UInt32.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt32 +Accessor UInt32.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32.Words._value.Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor UInt32._value.Modify() has return type change from () to inout @yields Builtin.Int32 +Accessor UInt64.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt64 +Accessor UInt64.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt64 +Accessor UInt64.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt64 +Accessor UInt64.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt64 +Accessor UInt64.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt64 +Accessor UInt64.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt64 +Accessor UInt64.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64.Words._value.Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor UInt64._value.Modify() has return type change from () to inout @yields Builtin.Int64 +Accessor UInt8.SIMD16Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec16xInt8 +Accessor UInt8.SIMD16Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8.SIMD2Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec2xInt8 +Accessor UInt8.SIMD2Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8.SIMD32Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec32xInt8 +Accessor UInt8.SIMD32Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8.SIMD4Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec4xInt8 +Accessor UInt8.SIMD4Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8.SIMD64Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec64xInt8 +Accessor UInt8.SIMD64Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8.SIMD8Storage._value.Modify() has return type change from () to inout @yields Builtin.Vec8xInt8 +Accessor UInt8.SIMD8Storage.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8.Words._value.Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UInt8._value.Modify() has return type change from () to inout @yields Builtin.Int8 +Accessor UnfoldSequence._done.Modify() has return type change from () to inout @yields Swift.Bool +Accessor UnfoldSequence._state.Modify() has return type change from () to inout @yields τ_0_1 +Accessor Unicode.Scalar.Properties._scalar.Modify() has return type change from () to inout @yields Swift.Unicode.Scalar +Accessor Unicode.Scalar.UTF16View.value.Modify() has return type change from () to inout @yields Swift.Unicode.Scalar +Accessor Unicode.Scalar.UTF8View.value.Modify() has return type change from () to inout @yields Swift.Unicode.Scalar +Accessor Unicode.Scalar._value.Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor Unicode.UTF16.ForwardParser._buffer.Modify() has return type change from () to inout @yields Swift._UIntBuffer +Accessor Unicode.UTF16.ReverseParser._buffer.Modify() has return type change from () to inout @yields Swift._UIntBuffer +Accessor Unicode.UTF8.ForwardParser._buffer.Modify() has return type change from () to inout @yields Swift._UIntBuffer +Accessor Unicode.UTF8.ReverseParser._buffer.Modify() has return type change from () to inout @yields Swift._UIntBuffer +Accessor Unmanaged._value.Modify() has return type change from () to inout @yields τ_0_0 Accessor UnsafeBufferPointer._position.Get() has generic signature change from to Accessor UnsafeBufferPointer._position.Get() has mangled name changing from 'Swift.UnsafeBufferPointer._position.getter : Swift.Optional>' to '(extension in Swift):Swift.UnsafeBufferPointer< where A: ~Swift.Copyable>._position.getter : Swift.Optional>' Accessor UnsafeBufferPointer.baseAddress.Get() has generic signature change from to @@ -424,6 +803,8 @@ Accessor UnsafeBufferPointer.endIndex.Get() has generic signature change from .endIndex.getter : Swift.Int' Accessor UnsafeBufferPointer.startIndex.Get() has generic signature change from to Accessor UnsafeBufferPointer.startIndex.Get() has mangled name changing from 'Swift.UnsafeBufferPointer.startIndex.getter : Swift.Int' to '(extension in Swift):Swift.UnsafeBufferPointer< where A: ~Swift.Copyable>.startIndex.getter : Swift.Int' +Accessor UnsafeBufferPointer.Iterator._end.Modify() has return type change from () to inout @yields Swift.UnsafePointer<τ_0_0>? +Accessor UnsafeBufferPointer.Iterator._position.Modify() has return type change from () to inout @yields Swift.UnsafePointer<τ_0_0>? Accessor UnsafeMutableBufferPointer._position.Get() has generic signature change from to Accessor UnsafeMutableBufferPointer._position.Get() has mangled name changing from 'Swift.UnsafeMutableBufferPointer._position.getter : Swift.Optional>' to '(extension in Swift):Swift.UnsafeMutableBufferPointer< where A: ~Swift.Copyable>._position.getter : Swift.Optional>' Accessor UnsafeMutableBufferPointer.baseAddress.Get() has generic signature change from to @@ -434,6 +815,8 @@ Accessor UnsafeMutableBufferPointer.endIndex.Get() has generic signature change Accessor UnsafeMutableBufferPointer.endIndex.Get() has mangled name changing from 'Swift.UnsafeMutableBufferPointer.endIndex.getter : Swift.Int' to '(extension in Swift):Swift.UnsafeMutableBufferPointer< where A: ~Swift.Copyable>.endIndex.getter : Swift.Int' Accessor UnsafeMutableBufferPointer.startIndex.Get() has generic signature change from to Accessor UnsafeMutableBufferPointer.startIndex.Get() has mangled name changing from 'Swift.UnsafeMutableBufferPointer.startIndex.getter : Swift.Int' to '(extension in Swift):Swift.UnsafeMutableBufferPointer< where A: ~Swift.Copyable>.startIndex.getter : Swift.Int' +Accessor UnsafeMutableBufferPointer.subscript(_:).Modify() has return type change from () to inout @yields Swift.Slice> +Accessor UnsafeMutableBufferPointer.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 Accessor UnsafeMutablePointer._cVarArgEncoding.Get() has generic signature change from to Accessor UnsafeMutablePointer._cVarArgEncoding.Get() has mangled name changing from 'Swift.UnsafeMutablePointer._cVarArgEncoding.getter : Swift.Array' to '(extension in Swift):Swift.UnsafeMutablePointer< where A: ~Swift.Copyable>._cVarArgEncoding.getter : Swift.Array' Accessor UnsafeMutablePointer._max.Get() has generic signature change from to @@ -442,6 +825,10 @@ Accessor UnsafeMutablePointer._rawValue.Get() has generic signature change from Accessor UnsafeMutablePointer._rawValue.Get() has mangled name changing from 'Swift.UnsafeMutablePointer._rawValue.getter : Builtin.RawPointer' to '(extension in Swift):Swift.UnsafeMutablePointer< where A: ~Swift.Copyable>._rawValue.getter : Builtin.RawPointer' Accessor UnsafeMutablePointer.hashValue.Get() has generic signature change from to Accessor UnsafeMutablePointer.hashValue.Get() has mangled name changing from 'Swift.UnsafeMutablePointer.hashValue.getter : Swift.Int' to '(extension in Swift):Swift.UnsafeMutablePointer< where A: ~Swift.Copyable>.hashValue.getter : Swift.Int' +Accessor UnsafeMutableRawBufferPointer.subscript(_:).Modify() has return type change from () to inout @yields Swift.Slice +Accessor UnsafeMutableRawBufferPointer.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor UnsafeRawBufferPointer.Iterator._end.Modify() has return type change from () to inout @yields Swift.UnsafeRawPointer? +Accessor UnsafeRawBufferPointer.Iterator._position.Modify() has return type change from () to inout @yields Swift.UnsafeRawPointer? Accessor UnsafePointer._cVarArgEncoding.Get() has generic signature change from to Accessor UnsafePointer._cVarArgEncoding.Get() has mangled name changing from 'Swift.UnsafePointer._cVarArgEncoding.getter : Swift.Array' to '(extension in Swift):Swift.UnsafePointer< where A: ~Swift.Copyable>._cVarArgEncoding.getter : Swift.Array' Accessor UnsafePointer._max.Get() has generic signature change from to @@ -450,6 +837,91 @@ Accessor UnsafePointer._rawValue.Get() has generic signature change from ._rawValue.getter : Builtin.RawPointer' Accessor UnsafePointer.hashValue.Get() has generic signature change from to Accessor UnsafePointer.hashValue.Get() has mangled name changing from 'Swift.UnsafePointer.hashValue.getter : Swift.Int' to '(extension in Swift):Swift.UnsafePointer< where A: ~Swift.Copyable>.hashValue.getter : Swift.Int' +Accessor Zip2Sequence.Iterator._baseStream1.Modify() has return type change from () to inout @yields τ_0_0.Iterator +Accessor Zip2Sequence.Iterator._baseStream2.Modify() has return type change from () to inout @yields τ_0_1.Iterator +Accessor Zip2Sequence.Iterator._reachedEnd.Modify() has return type change from () to inout @yields Swift.Bool +Accessor _ArrayBody._capacityAndFlags.Modify() has return type change from () to inout @yields Swift.UInt +Accessor _ArrayBody._storage.Modify() has return type change from () to inout @yields SwiftShims._SwiftArrayBodyStorage +Accessor _ArrayBody.count.Modify() has return type change from () to inout @yields Swift.Int +Accessor _ArrayBody.elementTypeIsBridgedVerbatim.Modify() has return type change from () to inout @yields Swift.Bool +Accessor _ArrayBuffer._storage.Modify() has return type change from () to inout @yields Swift._BridgeStorage +Accessor _ArrayBuffer.count.Modify() has return type change from () to inout @yields Swift.Int +Accessor _ArrayBuffer.subscript(_:).Modify() has return type change from () to inout @yields Swift._SliceBuffer<τ_0_0> +Accessor _ArrayBuffer.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor _ArrayBufferProtocol.count.Modify() has return type change from () to inout @yields Swift.Int +Accessor _BidirectionalCollectionBox._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor _BridgeStorage.rawValue.Modify() has return type change from () to inout @yields Builtin.BridgeObject +Accessor _ClosureBasedSequence._makeUnderlyingIterator.Modify() has return type change from () to inout @yields () -> τ_0_0 +Accessor _CocoaArrayWrapper.buffer.Modify() has return type change from () to inout @yields AnyObject +Accessor _CollectionBox._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor _ContiguousArrayBuffer._storage.Modify() has return type change from () to inout @yields Swift.__ContiguousArrayStorageBase +Accessor _ContiguousArrayBuffer.count.Modify() has return type change from () to inout @yields Swift.Int +Accessor _ContiguousArrayBuffer.subscript(_:).Modify() has return type change from () to inout @yields Swift._SliceBuffer<τ_0_0> +Accessor _ContiguousArrayBuffer.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor _DictionaryBuilder._target.Modify() has return type change from () to inout @yields Swift._NativeDictionary<τ_0_0, τ_0_1> +Accessor _HashTable.Bucket.offset.Modify() has return type change from () to inout @yields Swift.Int +Accessor _HashTable.Iterator.word.Modify() has return type change from () to inout @yields Swift._UnsafeBitset.Word +Accessor _HashTable.Iterator.wordIndex.Modify() has return type change from () to inout @yields Swift.Int +Accessor _HashTable.words.Modify() has return type change from () to inout @yields Swift.UnsafeMutablePointer +Accessor _IndexBox._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor _IteratorBox._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor _NativeDictionary.Iterator.iterator.Modify() has return type change from () to inout @yields Swift._HashTable.Iterator +Accessor _NativeDictionary._storage.Modify() has return type change from () to inout @yields Swift.__RawDictionaryStorage +Accessor _NativeDictionary.subscript(_:isUnique:).Modify() has return type change from () to inout @yields τ_0_1? +Accessor _NativeSet.Iterator.iterator.Modify() has return type change from () to inout @yields Swift._HashTable.Iterator +Accessor _NativeSet._storage.Modify() has return type change from () to inout @yields Swift.__RawSetStorage +Accessor _RandomAccessCollectionBox._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor _SequenceBox._base.Modify() has return type change from () to inout @yields τ_0_0 +Accessor _SetBuilder._target.Modify() has return type change from () to inout @yields Swift._NativeSet<τ_0_0> +Accessor _SliceBuffer.count.Modify() has return type change from () to inout @yields Swift.Int +Accessor _SliceBuffer.endIndex.Modify() has return type change from () to inout @yields Swift.Int +Accessor _SliceBuffer.endIndexAndFlags.Modify() has return type change from () to inout @yields Swift.UInt +Accessor _SliceBuffer.owner.Modify() has return type change from () to inout @yields AnyObject +Accessor _SliceBuffer.startIndex.Modify() has return type change from () to inout @yields Swift.Int +Accessor _SliceBuffer.subscript(_:).Modify() has return type change from () to inout @yields Swift._SliceBuffer<τ_0_0> +Accessor _SliceBuffer.subscript(_:).Modify() has return type change from () to inout @yields τ_0_0 +Accessor _SmallString._storage.Modify() has return type change from () to inout @yields (Swift.UInt64, Swift.UInt64) +Accessor _SmallString.leadingRawBits.Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor _SmallString.subscript(_:).Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor _SmallString.trailingRawBits.Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor _StringGuts._object.Modify() has return type change from () to inout @yields Swift._StringObject +Accessor _StringObject.CountAndFlags._storage.Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor _StringObject._countAndFlagsBits.Modify() has return type change from () to inout @yields Swift.UInt64 +Accessor _StringObject._object.Modify() has return type change from () to inout @yields Builtin.BridgeObject +Accessor _StringRepresentation._capacity.Modify() has return type change from () to inout @yields Swift.Int +Accessor _StringRepresentation._count.Modify() has return type change from () to inout @yields Swift.Int +Accessor _StringRepresentation._form.Modify() has return type change from () to inout @yields Swift._StringRepresentation._Form +Accessor _StringRepresentation._isASCII.Modify() has return type change from () to inout @yields Swift.Bool +Accessor _UIntBuffer.Index.bitOffset.Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor _UIntBuffer.Iterator._impl.Modify() has return type change from () to inout @yields Swift._UIntBuffer<τ_0_0> +Accessor _UIntBuffer._bitCount.Modify() has return type change from () to inout @yields Swift.UInt8 +Accessor _UIntBuffer._storage.Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor _UTFParser._buffer.Modify() has return type change from () to inout @yields Swift._UIntBuffer<τ_0_0.Encoding.CodeUnit> +Accessor _UnsafeBitset.Iterator.index.Modify() has return type change from () to inout @yields Swift.Int +Accessor _UnsafeBitset.Iterator.word.Modify() has return type change from () to inout @yields Swift._UnsafeBitset.Word +Accessor _UnsafeBitset.Word.value.Modify() has return type change from () to inout @yields Swift.UInt +Accessor _UnsafePartiallyInitializedContiguousArrayBuffer.p.Modify() has return type change from () to inout @yields Swift.UnsafeMutablePointer<τ_0_0> +Accessor _UnsafePartiallyInitializedContiguousArrayBuffer.remainingCapacity.Modify() has return type change from () to inout @yields Swift.Int +Accessor _UnsafePartiallyInitializedContiguousArrayBuffer.result.Modify() has return type change from () to inout @yields Swift._ContiguousArrayBuffer<τ_0_0> +Accessor _ValidUTF8Buffer.Index._biasedBits.Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor _ValidUTF8Buffer.Iterator._biasedBits.Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor _ValidUTF8Buffer._biasedBits.Modify() has return type change from () to inout @yields Swift.UInt32 +Accessor __ContiguousArrayStorageBase.countAndCapacity.Modify() has return type change from () to inout @yields Swift._ArrayBody +Accessor __RawDictionaryStorage._age.Modify() has return type change from () to inout @yields Swift.Int32 +Accessor __RawDictionaryStorage._capacity.Modify() has return type change from () to inout @yields Swift.Int +Accessor __RawDictionaryStorage._count.Modify() has return type change from () to inout @yields Swift.Int +Accessor __RawDictionaryStorage._rawKeys.Modify() has return type change from () to inout @yields Swift.UnsafeMutableRawPointer +Accessor __RawDictionaryStorage._rawValues.Modify() has return type change from () to inout @yields Swift.UnsafeMutableRawPointer +Accessor __RawDictionaryStorage._reservedScale.Modify() has return type change from () to inout @yields Swift.Int8 +Accessor __RawDictionaryStorage._scale.Modify() has return type change from () to inout @yields Swift.Int8 +Accessor __RawDictionaryStorage._seed.Modify() has return type change from () to inout @yields Swift.Int +Accessor __RawSetStorage._age.Modify() has return type change from () to inout @yields Swift.Int32 +Accessor __RawSetStorage._capacity.Modify() has return type change from () to inout @yields Swift.Int +Accessor __RawSetStorage._count.Modify() has return type change from () to inout @yields Swift.Int +Accessor __RawSetStorage._rawElements.Modify() has return type change from () to inout @yields Swift.UnsafeMutableRawPointer +Accessor __RawSetStorage._reservedScale.Modify() has return type change from () to inout @yields Swift.Int8 +Accessor __RawSetStorage._scale.Modify() has return type change from () to inout @yields Swift.Int8 +Accessor __RawSetStorage._seed.Modify() has return type change from () to inout @yields Swift.Int Class ManagedBuffer has generic signature change from to Constructor ExpressibleByNilLiteral.init(nilLiteral:) has generic signature change from to Constructor ManagedBuffer.init(_doNotCallMe:) has generic signature change from to diff --git a/test/attr/attr_native_dynamic.swift b/test/attr/attr_native_dynamic.swift index 9f7a7bfb74030..192c924754757 100644 --- a/test/attr/attr_native_dynamic.swift +++ b/test/attr/attr_native_dynamic.swift @@ -5,7 +5,7 @@ struct Strukt { // CHECK: (var_decl {{.*}} "dynamicStorageOnlyVar" interface_type="Int" access=internal dynamic readImpl=stored writeImpl=stored readWriteImpl=stored // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="dynamicStorageOnlyVar" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="dynamicStorageOnlyVar" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="dynamicStorageOnlyVar" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="dynamicStorageOnlyVar" dynamic var dynamicStorageOnlyVar : Int = 0 // CHECK: (var_decl {{.*}} "computedVar" interface_type="Int" access=internal dynamic readImpl=getter immutable @@ -25,7 +25,7 @@ struct Strukt { // CHECK: (var_decl {{.*}} "computedVarGetterSetter" interface_type="Int" access=internal dynamic readImpl=getter writeImpl=setter readWriteImpl=materialize_to_temporary // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="computedVarGetterSetter" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="computedVarGetterSetter" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="computedVarGetterSetter" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="computedVarGetterSetter" dynamic var computedVarGetterSetter : Int { get { return 0 @@ -36,7 +36,7 @@ struct Strukt { // CHECK: (var_decl {{.*}} "computedVarGetterModify" interface_type="Int" access=internal dynamic readImpl=getter writeImpl=modify_coroutine readWriteImpl=modify_coroutine // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="computedVarGetterModify" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="computedVarGetterModify" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="computedVarGetterModify" // CHECK: (accessor_decl {{.*}} access=internal set for="computedVarGetterModify" dynamic var computedVarGetterModify : Int { get { @@ -47,10 +47,10 @@ struct Strukt { } // CHECK: (var_decl {{.*}} "computedVarReadSet" interface_type="Int" access=internal dynamic readImpl=read_coroutine writeImpl=setter readWriteImpl=materialize_to_temporary - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="computedVarReadSet" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="computedVarReadSet" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="computedVarReadSet" // CHECK: (accessor_decl {{.*}} access=internal get for="computedVarReadSet" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="computedVarReadSet" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="computedVarReadSet" dynamic var computedVarReadSet : Int { _read { } @@ -59,8 +59,8 @@ struct Strukt { } // CHECK: (var_decl {{.*}} "computedVarReadModify" interface_type="Int" access=internal dynamic readImpl=read_coroutine writeImpl=modify_coroutine readWriteImpl=modify_coroutine - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="computedVarReadModify" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="computedVarReadModify" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="computedVarReadModify" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="computedVarReadModify" // CHECK: (accessor_decl {{.*}} access=internal get for="computedVarReadModify" // CHECK: (accessor_decl {{.*}} access=internal set for="computedVarReadModify" dynamic var computedVarReadModify : Int { @@ -74,7 +74,7 @@ struct Strukt { // CHECK: (accessor_decl {{.*}}access=private dynamic didSet for="storedWithObserver" // CHECK: (accessor_decl {{.*}}access=internal dynamic get for="storedWithObserver" // CHECK: (accessor_decl {{.*}}access=internal set for="storedWithObserver" - // CHECK: (accessor_decl {{.*}}access=internal _modify for="storedWithObserver" + // CHECK: (accessor_decl {{.*}}access=internal @yield_once _modify for="storedWithObserver" dynamic var storedWithObserver : Int { didSet { } @@ -88,7 +88,7 @@ struct Strukt { // CHECK: (subscript_decl {{.*}} "subscript(_:)" {{.*}} access=internal dynamic readImpl=getter writeImpl=setter readWriteImpl=materialize_to_temporary // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="subscript(_:)" dynamic subscript(_ index: Int) -> Int { get { return 1 @@ -99,7 +99,7 @@ struct Strukt { // CHECK: (subscript_decl {{.*}} "subscript(_:)" {{.*}} access=internal dynamic readImpl=getter writeImpl=modify_coroutine readWriteImpl=modify_coroutine // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal set for="subscript(_:)" dynamic subscript(_ index: Float) -> Int { get { @@ -110,8 +110,8 @@ struct Strukt { } // CHECK: (subscript_decl {{.*}} "subscript(_:)" {{.*}} access=internal dynamic readImpl=read_coroutine writeImpl=modify_coroutine readWriteImpl=modify_coroutine - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal get for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal set for="subscript(_:)" dynamic subscript(_ index: Double) -> Int { @@ -122,10 +122,10 @@ struct Strukt { } // CHECK: (subscript_decl {{.*}} "subscript(_:)" {{.*}} access=internal dynamic readImpl=read_coroutine writeImpl=setter readWriteImpl=materialize_to_temporary - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal get for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="subscript(_:)" dynamic subscript(_ index: Strukt) -> Int { _read { } @@ -139,7 +139,7 @@ class Klass { // CHECK: (var_decl {{.*}} "dynamicStorageOnlyVar" interface_type="Int" access=internal dynamic readImpl=stored writeImpl=stored readWriteImpl=stored // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="dynamicStorageOnlyVar" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="dynamicStorageOnlyVar" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="dynamicStorageOnlyVar" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="dynamicStorageOnlyVar" dynamic var dynamicStorageOnlyVar : Int = 0 // CHECK: (var_decl {{.*}} "computedVar" interface_type="Int" access=internal dynamic readImpl=getter immutable @@ -159,7 +159,7 @@ class Klass { // CHECK: (var_decl {{.*}} "computedVarGetterSetter" interface_type="Int" access=internal dynamic readImpl=getter writeImpl=setter readWriteImpl=materialize_to_temporary // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="computedVarGetterSetter" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="computedVarGetterSetter" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="computedVarGetterSetter" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="computedVarGetterSetter" dynamic var computedVarGetterSetter : Int { get { return 0 @@ -170,7 +170,7 @@ class Klass { // CHECK: (var_decl {{.*}} "computedVarGetterModify" interface_type="Int" access=internal dynamic readImpl=getter writeImpl=modify_coroutine readWriteImpl=modify_coroutine // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="computedVarGetterModify" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="computedVarGetterModify" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="computedVarGetterModify" // CHECK: (accessor_decl {{.*}} access=internal set for="computedVarGetterModify" dynamic var computedVarGetterModify : Int { get { @@ -181,10 +181,10 @@ class Klass { } // CHECK: (var_decl {{.*}} "computedVarReadSet" interface_type="Int" access=internal dynamic readImpl=read_coroutine writeImpl=setter readWriteImpl=materialize_to_temporary - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="computedVarReadSet" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="computedVarReadSet" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="computedVarReadSet" // CHECK: (accessor_decl {{.*}} access=internal get for="computedVarReadSet" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="computedVarReadSet" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="computedVarReadSet" dynamic var computedVarReadSet : Int { _read { } @@ -193,8 +193,8 @@ class Klass { } // CHECK: (var_decl {{.*}} "computedVarReadModify" interface_type="Int" access=internal dynamic readImpl=read_coroutine writeImpl=modify_coroutine readWriteImpl=modify_coroutine - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="computedVarReadModify" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="computedVarReadModify" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="computedVarReadModify" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="computedVarReadModify" // CHECK: (accessor_decl {{.*}} access=internal get for="computedVarReadModify" // CHECK: (accessor_decl {{.*}} access=internal set for="computedVarReadModify" dynamic var computedVarReadModify : Int { @@ -231,7 +231,7 @@ class Klass { // CHECK: (accessor_decl {{.*}} access=internal dynamic get for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal dynamic unsafeMutableAddress for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal set for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="subscript(_:)" dynamic subscript(_ index: Float) -> Int { get { return 1 @@ -242,11 +242,11 @@ class Klass { } // CHECK: (subscript_decl {{.*}} "subscript(_:)" {{.*}} access=internal dynamic readImpl=read_coroutine writeImpl=mutable_addressor readWriteImpl=mutable_addressor - // CHECK: (accessor_decl {{.*}} access=internal dynamic _read for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _read for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal dynamic unsafeMutableAddress for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal get for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal set for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="subscript(_:)" dynamic subscript(_ index: Double) -> Int { _read { } @@ -259,7 +259,7 @@ class Klass { // CHECK: (accessor_decl {{.*}} access=internal dynamic unsafeAddress for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal dynamic set for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal get for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal @yield_once _modify for="subscript(_:)" dynamic subscript(_ index: Int8) -> Int { unsafeAddress { fatalError() @@ -270,7 +270,7 @@ class Klass { // CHECK: (subscript_decl {{.*}} "subscript(_:)" {{.*}} access=internal dynamic readImpl=addressor writeImpl=modify_coroutine readWriteImpl=modify_coroutine // CHECK: (accessor_decl {{.*}} access=internal dynamic unsafeAddress for="subscript(_:)" - // CHECK: (accessor_decl {{.*}} access=internal dynamic _modify for="subscript(_:)" + // CHECK: (accessor_decl {{.*}} access=internal dynamic @yield_once _modify for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal get for="subscript(_:)" // CHECK: (accessor_decl {{.*}} access=internal set for="subscript(_:)" dynamic subscript(_ index: Int16) -> Int { diff --git a/test/embedded/classes-generic-no-stdlib.swift b/test/embedded/classes-generic-no-stdlib.swift index 580865fce0a9f..ea23ee0b040f4 100644 --- a/test/embedded/classes-generic-no-stdlib.swift +++ b/test/embedded/classes-generic-no-stdlib.swift @@ -38,7 +38,7 @@ public func bar(t: T2) -> MyClass { // CHECK-SIL: sil_vtable $MyClass { // CHECK-SIL: #MyClass.t!getter: (MyClass) -> () -> T : @$e4main7MyClassC1txvgAA2T2V_Tg5 // specialized MyClass.t.getter // CHECK-SIL: #MyClass.t!setter: (MyClass) -> (T) -> () : @$e4main7MyClassC1txvsAA2T2V_Tg5 // specialized MyClass.t.setter -// CHECK-SIL: #MyClass.t!modify: (MyClass) -> () -> () : @$e4main7MyClassC1txvMAA2T2V_Tg5 // specialized MyClass.t.modify +// CHECK-SIL: #MyClass.t!modify: (MyClass) -> @yield_once () -> inout @yields T : @$e4main7MyClassC1txvMAA2T2V_Tg5 // specialized MyClass.t.modify // CHECK-SIL: #MyClass.init!allocator: (MyClass.Type) -> (T) -> MyClass : @$e4main7MyClassC1tACyxGx_tcfCAA2T2V_Tg5 // specialized MyClass.__allocating_init(t:) // CHECK-SIL: #MyClass.deinit!deallocator: @$e4main7MyClassCfDAA2T2V_Tg5 // specialized MyClass.__deallocating_deinit // CHECK-SIL: } @@ -46,7 +46,7 @@ public func bar(t: T2) -> MyClass { // CHECK-SIL: sil_vtable $MyClass { // CHECK-SIL: #MyClass.t!getter: (MyClass) -> () -> T : @$e4main7MyClassC1txvgAA2T1V_Tg5 // specialized MyClass.t.getter // CHECK-SIL: #MyClass.t!setter: (MyClass) -> (T) -> () : @$e4main7MyClassC1txvsAA2T1V_Tg5 // specialized MyClass.t.setter -// CHECK-SIL: #MyClass.t!modify: (MyClass) -> () -> () : @$e4main7MyClassC1txvMAA2T1V_Tg5 // specialized MyClass.t.modify +// CHECK-SIL: #MyClass.t!modify: (MyClass) -> @yield_once () -> inout @yields T : @$e4main7MyClassC1txvMAA2T1V_Tg5 // specialized MyClass.t.modify // CHECK-SIL: #MyClass.init!allocator: (MyClass.Type) -> (T) -> MyClass : @$e4main7MyClassC1tACyxGx_tcfCAA2T1V_Tg5 // specialized MyClass.__allocating_init(t:) // CHECK-SIL: #MyClass.deinit!deallocator: @$e4main7MyClassCfDAA2T1V_Tg5 // specialized MyClass.__deallocating_deinit // CHECK-SIL: }