Merge branch 'main' into david/fix-merge-conflict

This commit is contained in:
David Smith
2020-10-27 13:05:20 -07:00
759 changed files with 23773 additions and 6047 deletions

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
@@ -845,6 +845,8 @@ void Serializer::writeBlockInfoBlock() {
decls_block::SPECIALIZED_PROTOCOL_CONFORMANCE);
BLOCK_RECORD_WITH_NAMESPACE(sil_block,
decls_block::INHERITED_PROTOCOL_CONFORMANCE);
BLOCK_RECORD_WITH_NAMESPACE(sil_block,
decls_block::BUILTIN_PROTOCOL_CONFORMANCE);
BLOCK_RECORD_WITH_NAMESPACE(sil_block,
decls_block::NORMAL_PROTOCOL_CONFORMANCE_ID);
BLOCK_RECORD_WITH_NAMESPACE(sil_block,
@@ -1055,11 +1057,7 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
ImportSet privateImportSet =
getImportsAsSet(M, ModuleDecl::ImportFilterKind::Default);
ImportSet spiImportSet =
getImportsAsSet(M, {
ModuleDecl::ImportFilterKind::Exported,
ModuleDecl::ImportFilterKind::Default,
ModuleDecl::ImportFilterKind::SPIAccessControl
});
getImportsAsSet(M, ModuleDecl::ImportFilterKind::SPIAccessControl);
auto clangImporter =
static_cast<ClangImporter *>(M->getASTContext().getClangModuleLoader());
@@ -1506,6 +1504,17 @@ Serializer::writeConformance(ProtocolConformanceRef conformanceRef,
writeConformance(conf->getInheritedConformance(), abbrCodes, genericEnv);
break;
}
case ProtocolConformanceKind::Builtin:
auto builtin = cast<BuiltinProtocolConformance>(conformance);
unsigned abbrCode = abbrCodes[BuiltinProtocolConformanceLayout::Code];
auto typeID = addTypeRef(builtin->getType());
auto protocolID = addDeclRef(builtin->getProtocol());
BuiltinProtocolConformanceLayout::emitRecord(Out, ScratchRecord, abbrCode,
typeID, protocolID,
builtin->getConformances().size());
writeConformances(builtin->getConformances(), abbrCodes);
break;
}
}
@@ -2294,6 +2303,14 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
return;
}
case DAK_ActorIndependent: {
auto *theAttr = cast<ActorIndependentAttr>(DA);
auto abbrCode = S.DeclTypeAbbrCodes[ActorIndependentDeclAttrLayout::Code];
ActorIndependentDeclAttrLayout::emitRecord(S.Out, S.ScratchRecord,
abbrCode, (unsigned)theAttr->getKind());
return;
}
case DAK_Optimize: {
auto *theAttr = cast<OptimizeAttr>(DA);
auto abbrCode = S.DeclTypeAbbrCodes[OptimizeDeclAttrLayout::Code];
@@ -4580,6 +4597,7 @@ void Serializer::writeAllDeclsAndTypes() {
registerDeclTypeAbbr<SpecializedProtocolConformanceLayout>();
registerDeclTypeAbbr<InheritedProtocolConformanceLayout>();
registerDeclTypeAbbr<InvalidProtocolConformanceLayout>();
registerDeclTypeAbbr<BuiltinProtocolConformanceLayout>();
registerDeclTypeAbbr<NormalProtocolConformanceIdLayout>();
registerDeclTypeAbbr<ProtocolConformanceXrefLayout>();