Rather than materializing the metadata on demand during visitation, only
collect the types that may be required. Finally, materialize everything
that's needed at the end.
Given a releasable value which contains a noncopyable value type with a
deinit, that values outlined release function, among other things, must
call the deinit of that noncopyable value type. In order to do that,
its type metadata must be passed to the value function if it has an
archetype.
Some outlined functions call deinits for noncopyable values. These
deinits require the metadata for the full type.
Teach the OutliningMetadataCollector to collect the metadata for these
types, when the new needsDeinit flag is set.
Also add the new needsLayout flag. For now, all outlined functions need
it.
MapVector started querying for constructability of stored types with
templates. As such, we need the definition of `LocalTypeDataKey` so that
it can instantiate the template.
We also lost a transitive include of `TinyPtrVector`, which we use, so
including it in `ConformanceLookupTable.h`.
Fixes a regression in the source compatibility suite which I had a
lot of trouble extracting into a separate test case.
Most of this patch is just moving the outlining code into a separate
file and organizing it into a helper class instead of copy/pasting
so much code. The main functional change is implicit in the difference
between collecting formal metadata and collecting it for layout, which
then is exploited in bindMetadataParameters.
As a secondary change, stop collecting metadata for class-bounded
archetypes; we don't actually need it to do value operations.