mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Summon the eldritch horror "EagerDeserializationDecls" from the bowels of history.
Adding explicit constructors to Clang-imported structs in the previous commits exposes a latent phase ordering issue between the Clang importer and SIL deserialization. Deserializing the standard library SIL ends up pulling in additional Clang decls which never get type-checked before we attempt to emit their code. Work around this by bringing back the "EagerDeserializedDecls" block in the serialization format, and adding any cross-referenced decls that get referenced in SILSerializeAll mode to it, so that we ensure they're available before SILGen. We also have to type-check external decls after doing so, since when only importing a module, we wouldn't do any type-checking at all otherwise. Swift SVN r23728
This commit is contained in:
@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// To ensure that two separate changes don't silently get merged into one
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// describe what change you made.
|
||||
const uint16_t VERSION_MINOR = 161; // Last change: witness_method serialization
|
||||
const uint16_t VERSION_MINOR = 162; // Last change: reintroduce force deserialization of decls
|
||||
|
||||
using DeclID = Fixnum<31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -1230,6 +1230,9 @@ namespace index_block {
|
||||
/// Objective-C selectors to the methods/initializers/properties/etc. that
|
||||
/// produce Objective-C methods.
|
||||
OBJC_METHODS,
|
||||
|
||||
/// A set of declarations to eagerly deserialize.
|
||||
FORCE_DESERIALIZATION,
|
||||
};
|
||||
|
||||
using OffsetsLayout = BCGenericRecordLayout<
|
||||
@@ -1248,6 +1251,11 @@ namespace index_block {
|
||||
BCVBR<16>, // table offset within the blob (see below)
|
||||
BCBlob // map from Objective-C selectors to methods with that selector
|
||||
>;
|
||||
|
||||
using ForceDeserializationTableLayout = BCRecordLayout<
|
||||
FORCE_DESERIALIZATION, // record ID
|
||||
BCArray<DeclIDField> // decl IDs to eagerly deserialize
|
||||
>;
|
||||
}
|
||||
|
||||
/// \sa COMMENT_BLOCK_ID
|
||||
|
||||
Reference in New Issue
Block a user