[Serialization] Wire up archetype generic environments eagerly.

Teach the serialized form of ArchetypeType about its owning generic
environment, so we can wire up the generic environment of (primary)
archetypes eagerly (at the point of deserialization) rather than when
we form the generic environment. This ensures that there is no point
at which we have a (non-opened-existential) archetype without a
generic environment.

... except that the type reconstruction code creates such archetypes.
This commit is contained in:
Doug Gregor
2017-01-06 11:10:47 -08:00
parent b75ef56bdc
commit ad90116da9
9 changed files with 90 additions and 169 deletions

View File

@@ -529,17 +529,6 @@ private:
serialization::DeclID willSet,
serialization::DeclID didSet);
/// Return the generic signature or environment at the current position in
/// the given cursor.
///
/// \param cursor The cursor to read from.
/// \param wantEnvironment Whether we always want to receive a generic
/// environment vs. being able to handle the generic signature.
llvm::PointerUnion<GenericSignature *, GenericEnvironment *>
readGenericSignatureOrEnvironment(
llvm::BitstreamCursor &cursor,
bool wantEnvironment);
public:
/// Loads a module from the given memory buffer.
///