[Serialization] Unique SIL generic environments when serializing.

Teach the serialization of SIL generic environments, which used to be
a trailing record following the SIL function definition, to use the
same uniqued "generic environment IDs" that are used for the AST
generic environments. Many of them overlap anyway, and SIL functions
tend to have AST generic environments anyway.

This approach guarantees that the AST + SIL deserialization provide
the same uniqueness of generic environments present prior to
serialization.
This commit is contained in:
Doug Gregor
2017-01-05 18:24:55 -08:00
parent 153ef7dbcb
commit 69cc9f4b54
9 changed files with 65 additions and 76 deletions

View File

@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
/// in source control, you should also update the comment to briefly
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
const uint16_t VERSION_MINOR = 302; // Last change: SIL box type substitutions
const uint16_t VERSION_MINOR = 303; // Last change: SIL generic environments
using DeclID = PointerEmbeddedInt<unsigned, 31>;
using DeclIDField = BCFixed<31>;