First cut of making coroutine AST type

This commit is contained in:
Anton Korobeynikov
2024-08-13 22:27:02 -07:00
parent 797f500286
commit 76c9a23f27
32 changed files with 223 additions and 71 deletions

View File

@@ -5730,8 +5730,13 @@ public:
visitBuiltinTypeImpl(ty);
}
void visitYieldResultType(const YieldResultType *) {
llvm_unreachable("implemented me");
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) {
@@ -6023,7 +6028,8 @@ public:
S.addTypeRef(fnTy->getThrownError()),
getRawStableDifferentiabilityKind(fnTy->getDifferentiabilityKind()),
isolation,
fnTy->hasSendingResult());
fnTy->hasSendingResult(),
fnTy->isCoroutine());
serializeFunctionTypeParams(fnTy);
@@ -6045,7 +6051,7 @@ public:
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);
@@ -6483,6 +6489,8 @@ void Serializer::writeAllDeclsAndTypes() {
registerDeclTypeAbbr<ClangTypeLayout>();
registerDeclTypeAbbr<YieldResultTypeLayout>();
registerDeclTypeAbbr<TypeAliasLayout>();
registerDeclTypeAbbr<GenericTypeParamTypeLayout>();
registerDeclTypeAbbr<DependentMemberTypeLayout>();