mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -690,6 +690,7 @@ matchCallArguments(ConstraintSystem &cs, ConstraintKind kind,
|
||||
case ConstraintKind::BindOverload:
|
||||
case ConstraintKind::CheckedCast:
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::Defaultable:
|
||||
case ConstraintKind::Disjunction:
|
||||
case ConstraintKind::DynamicTypeOf:
|
||||
@@ -816,6 +817,7 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
|
||||
case ConstraintKind::BindOverload:
|
||||
case ConstraintKind::CheckedCast:
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::Defaultable:
|
||||
case ConstraintKind::Disjunction:
|
||||
case ConstraintKind::DynamicTypeOf:
|
||||
@@ -930,6 +932,7 @@ static bool matchFunctionRepresentations(FunctionTypeRepresentation rep1,
|
||||
case ConstraintKind::BindOverload:
|
||||
case ConstraintKind::CheckedCast:
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::Defaultable:
|
||||
case ConstraintKind::Disjunction:
|
||||
case ConstraintKind::DynamicTypeOf:
|
||||
@@ -997,6 +1000,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
|
||||
case ConstraintKind::BindOverload:
|
||||
case ConstraintKind::CheckedCast:
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::Defaultable:
|
||||
case ConstraintKind::Disjunction:
|
||||
case ConstraintKind::DynamicTypeOf:
|
||||
@@ -1500,6 +1504,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
case ConstraintKind::BridgingConversion:
|
||||
case ConstraintKind::CheckedCast:
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::Defaultable:
|
||||
case ConstraintKind::Disjunction:
|
||||
case ConstraintKind::DynamicTypeOf:
|
||||
@@ -4181,6 +4186,7 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
|
||||
subflags, locator);
|
||||
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::LiteralConformsTo:
|
||||
case ConstraintKind::SelfObjectOfProtocol:
|
||||
return simplifyConformsToConstraint(first, second, kind, locator,
|
||||
@@ -4335,6 +4341,7 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
|
||||
return SolutionKind::Solved;
|
||||
|
||||
case ConstraintKind::ConformsTo:
|
||||
case ConstraintKind::Layout:
|
||||
case ConstraintKind::LiteralConformsTo:
|
||||
case ConstraintKind::SelfObjectOfProtocol:
|
||||
return simplifyConformsToConstraint(
|
||||
|
||||
Reference in New Issue
Block a user