[AST] Teach the AST verifier not to deserialize generic environments.

The AST verifier was causing deserialization of generic environments,
which slows things down considerably and affects our ability to test
for laziness in deserialization. Prevent it from doing so---and only
do the extra checkig if something else deserialized the generic
environment already.

... except there are some cases where it happens through means that
are harder to control (e.g., the AST walker for patterns) that need
more thought.
This commit is contained in:
Doug Gregor
2017-05-16 11:03:15 -07:00
parent 9ff7ff73ef
commit f792aeaf1a
5 changed files with 134 additions and 41 deletions

View File

@@ -312,6 +312,10 @@ public:
/// of its parents.
GenericEnvironment *getGenericEnvironmentOfContext() const;
/// Whether the context has a generic environment that will be constructed
/// on first access (but has not yet been constructed).
bool contextHasLazyGenericEnvironment() const;
/// Map an interface type to a contextual type within this context.
Type mapTypeIntoContext(Type type) const;