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

@@ -223,6 +223,10 @@ class Traversal : public ASTVisitor<Traversal, Expr*, Stmt*,
if (doIt(Req.getSubjectLoc()) || doIt(Req.getConstraintLoc()))
return true;
break;
case RequirementReprKind::LayoutConstraint:
if (doIt(Req.getFirstTypeLoc()))
return true;
break;
}
}
}
@@ -279,6 +283,10 @@ class Traversal : public ASTVisitor<Traversal, Expr*, Stmt*,
if (doIt(Req.getSubjectLoc()) || doIt(Req.getConstraintLoc()))
return true;
break;
case RequirementReprKind::LayoutConstraint:
if (doIt(Req.getSubjectLoc()))
return true;
break;
}
}
}