SIL: Track target formal type for casts

SIL type lowering erases DynamicSelfType, so we generate
incorrect code when casting to DynamicSelfType. Fixing this
requires a fair amount of plumbing, but most of the
changes are mechanical.

Note that the textual SIL syntax for casts has changed
slightly; the target type is now a formal type without a '$',
not a SIL type.

Also, the unconditional_checked_cast_value and
checked_cast_value_br instructions now take the _source_
formal type as well, just like the *_addr forms they are
intended to replace.
This commit is contained in:
Slava Pestov
2019-11-20 00:33:51 -05:00
parent eaad4fc780
commit 53bfc767a3
125 changed files with 983 additions and 852 deletions

View File

@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// 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.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 524; // function type differentiability
const uint16_t SWIFTMODULE_VERSION_MINOR = 525; // target formal type for casts
/// A standard hash seed used for all string hashes in a serialized module.
///