mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Serialize hasMissingDesignatedInitializers
Since this is going to be something modules tell clients, rather than something clients discover about modules, serialize it.
This commit is contained in:
committed by
Robert Widmann
parent
b133b7e3da
commit
8e45f44da4
@@ -3416,6 +3416,7 @@ public:
|
|||||||
DeclContextID contextID;
|
DeclContextID contextID;
|
||||||
bool isImplicit, isObjC;
|
bool isImplicit, isObjC;
|
||||||
bool inheritsSuperclassInitializers;
|
bool inheritsSuperclassInitializers;
|
||||||
|
bool hasMissingDesignatedInits;
|
||||||
GenericSignatureID genericSigID;
|
GenericSignatureID genericSigID;
|
||||||
TypeID superclassID;
|
TypeID superclassID;
|
||||||
uint8_t rawAccessLevel;
|
uint8_t rawAccessLevel;
|
||||||
@@ -3424,6 +3425,7 @@ public:
|
|||||||
decls_block::ClassLayout::readRecord(scratch, nameID, contextID,
|
decls_block::ClassLayout::readRecord(scratch, nameID, contextID,
|
||||||
isImplicit, isObjC,
|
isImplicit, isObjC,
|
||||||
inheritsSuperclassInitializers,
|
inheritsSuperclassInitializers,
|
||||||
|
hasMissingDesignatedInits,
|
||||||
genericSigID, superclassID,
|
genericSigID, superclassID,
|
||||||
rawAccessLevel, numConformances,
|
rawAccessLevel, numConformances,
|
||||||
numInheritedTypes,
|
numInheritedTypes,
|
||||||
@@ -3466,6 +3468,8 @@ public:
|
|||||||
theClass->setSuperclass(MF.getType(superclassID));
|
theClass->setSuperclass(MF.getType(superclassID));
|
||||||
ctx.evaluator.cacheOutput(InheritsSuperclassInitializersRequest{theClass},
|
ctx.evaluator.cacheOutput(InheritsSuperclassInitializersRequest{theClass},
|
||||||
std::move(inheritsSuperclassInitializers));
|
std::move(inheritsSuperclassInitializers));
|
||||||
|
ctx.evaluator.cacheOutput(HasMissingDesignatedInitializersRequest{theClass},
|
||||||
|
std::move(hasMissingDesignatedInits));
|
||||||
|
|
||||||
handleInherited(theClass,
|
handleInherited(theClass,
|
||||||
rawInheritedAndDependencyIDs.slice(0, numInheritedTypes));
|
rawInheritedAndDependencyIDs.slice(0, numInheritedTypes));
|
||||||
@@ -5390,7 +5394,8 @@ Decl *handleErrorAndSupplyMissingClassMember(ASTContext &context,
|
|||||||
Decl *suppliedMissingMember = nullptr;
|
Decl *suppliedMissingMember = nullptr;
|
||||||
auto handleMissingClassMember = [&](const DeclDeserializationError &error) {
|
auto handleMissingClassMember = [&](const DeclDeserializationError &error) {
|
||||||
if (error.isDesignatedInitializer())
|
if (error.isDesignatedInitializer())
|
||||||
containingClass->setHasMissingDesignatedInitializers();
|
context.evaluator.cacheOutput(
|
||||||
|
HasMissingDesignatedInitializersRequest{containingClass}, true);
|
||||||
if (error.getNumberOfVTableEntries() > 0)
|
if (error.getNumberOfVTableEntries() > 0)
|
||||||
containingClass->setHasMissingVTableEntries();
|
containingClass->setHasMissingVTableEntries();
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
|
|||||||
/// describe what change you made. The content of this comment isn't important;
|
/// 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.
|
/// 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.
|
/// Don't worry about adhering to the 80-column limit for this line.
|
||||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 531; // function parameter noDerivative
|
const uint16_t SWIFTMODULE_VERSION_MINOR = 532; // @_hasMissingDesignatedInitializers
|
||||||
|
|
||||||
/// A standard hash seed used for all string hashes in a serialized module.
|
/// A standard hash seed used for all string hashes in a serialized module.
|
||||||
///
|
///
|
||||||
@@ -1114,6 +1114,7 @@ namespace decls_block {
|
|||||||
BCFixed<1>, // implicit?
|
BCFixed<1>, // implicit?
|
||||||
BCFixed<1>, // explicitly objc?
|
BCFixed<1>, // explicitly objc?
|
||||||
BCFixed<1>, // inherits convenience initializers from its superclass?
|
BCFixed<1>, // inherits convenience initializers from its superclass?
|
||||||
|
BCFixed<1>, // has missing designated initializers?
|
||||||
GenericSignatureIDField, // generic environment
|
GenericSignatureIDField, // generic environment
|
||||||
TypeIDField, // superclass
|
TypeIDField, // superclass
|
||||||
AccessLevelField, // access level
|
AccessLevelField, // access level
|
||||||
|
|||||||
@@ -3139,9 +3139,7 @@ public:
|
|||||||
uint8_t rawAccessLevel =
|
uint8_t rawAccessLevel =
|
||||||
getRawStableAccessLevel(theClass->getFormalAccess());
|
getRawStableAccessLevel(theClass->getFormalAccess());
|
||||||
|
|
||||||
bool inheritsSuperclassInitializers =
|
auto mutableClass = const_cast<ClassDecl *>(theClass);
|
||||||
const_cast<ClassDecl *>(theClass)->
|
|
||||||
inheritsSuperclassInitializers();
|
|
||||||
|
|
||||||
unsigned abbrCode = S.DeclTypeAbbrCodes[ClassLayout::Code];
|
unsigned abbrCode = S.DeclTypeAbbrCodes[ClassLayout::Code];
|
||||||
ClassLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode,
|
ClassLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode,
|
||||||
@@ -3149,7 +3147,8 @@ public:
|
|||||||
contextID.getOpaqueValue(),
|
contextID.getOpaqueValue(),
|
||||||
theClass->isImplicit(),
|
theClass->isImplicit(),
|
||||||
theClass->isObjC(),
|
theClass->isObjC(),
|
||||||
inheritsSuperclassInitializers,
|
mutableClass->inheritsSuperclassInitializers(),
|
||||||
|
mutableClass->hasMissingDesignatedInitializers(),
|
||||||
S.addGenericSignatureRef(
|
S.addGenericSignatureRef(
|
||||||
theClass->getGenericSignature()),
|
theClass->getGenericSignature()),
|
||||||
S.addTypeRef(theClass->getSuperclass()),
|
S.addTypeRef(theClass->getSuperclass()),
|
||||||
|
|||||||
Reference in New Issue
Block a user