Add support for layout requirements with layout constraints.

This commit introduces new kind of requirements: layout requirements.

This kind of requirements allows to expose that a type should satisfy certain layout properties, e.g. it should be a trivial type, have a given size and alignment, etc.
This commit is contained in:
Roman Levenstein
2017-01-11 12:45:51 -08:00
parent 94e6a34b32
commit 29180ca1a0
28 changed files with 520 additions and 90 deletions

View File

@@ -3165,6 +3165,9 @@ bool swift::isExtensionApplied(DeclContext &DC, Type BaseTy,
case RequirementKind::Conformance:
createMemberConstraint(Req, ConstraintKind::ConformsTo);
break;
case RequirementKind::Layout:
createMemberConstraint(Req, ConstraintKind::Layout);
break;
case RequirementKind::Superclass:
createMemberConstraint(Req, ConstraintKind::Subtype);
break;