[Serialization] Support (de-)serialization of SubstitutionMaps.

Allow substitution maps to be serialized directly (via an ID), writing out
the replacement types and conformances as appropriate. This is a more
efficient form of serialization than the current SubstitutionList approach,
because it maintains uniqueness of substitution maps within a module file,
and is a step toward eliminating SubstitutionList entirely.
This commit is contained in:
Doug Gregor
2018-04-30 16:21:58 -07:00
parent 547abf1724
commit ab56fa3e9c
8 changed files with 253 additions and 17 deletions

View File

@@ -852,6 +852,10 @@ bool ModuleFile::readIndexBlock(llvm::BitstreamCursor &cursor) {
assert(blobData.empty());
GenericEnvironments.assign(scratch.begin(), scratch.end());
break;
case index_block::SUBSTITUTION_MAP_OFFSETS:
assert(blobData.empty());
SubstitutionMaps.assign(scratch.begin(), scratch.end());
break;
case index_block::NORMAL_CONFORMANCE_OFFSETS:
assert(blobData.empty());
NormalConformances.assign(scratch.begin(), scratch.end());