[Serialization/AST] Lazily construct generic environments for generic types.

When deserializing the generic environment for a generic type, only
immediately deserialize the generic signature. The generic environment
will be deserialized later, when it's needed.
This commit is contained in:
Doug Gregor
2016-12-12 20:17:07 -08:00
parent 1739e14276
commit 02ac9b593a
7 changed files with 141 additions and 34 deletions

View File

@@ -449,6 +449,13 @@ private:
void readGenericRequirements(SmallVectorImpl<Requirement> &requirements,
llvm::BitstreamCursor &Cursor);
/// Allocate a lazy generic environment map for use with lazily deserialized
/// generic environments.
uint64_t allocateLazyGenericEnvironmentMap(TypeSubstitutionMap &&map);
/// Set up a lazy generic environment for the given type.
void readLazyGenericEnvironment(GenericTypeDecl *type);
/// Read the generic signature and type substitution map for a
/// generic environment from \c Cursor.
std::pair<GenericSignature *, TypeSubstitutionMap>