mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SilOpt] Add new layout type _TrivialStride and add pre-specialization suppport for it (#70308)
rdar://119329771 This layout allows adding pre-specializations for trivial types that have a different size, but the same stride. This is especially useful for collections, where the stride is the important factor.
This commit is contained in:
@@ -1185,6 +1185,7 @@ getActualLayoutConstraintKind(uint64_t rawKind) {
|
||||
CASE(NativeClass)
|
||||
CASE(UnknownLayout)
|
||||
CASE(BridgeObject)
|
||||
CASE(TrivialStride)
|
||||
}
|
||||
#undef CASE
|
||||
|
||||
@@ -1244,7 +1245,8 @@ llvm::Error ModuleFile::deserializeGenericRequirementsChecked(
|
||||
ASTContext &ctx = getContext();
|
||||
LayoutConstraint layout;
|
||||
if (kind != LayoutConstraintKind::TrivialOfAtMostSize &&
|
||||
kind != LayoutConstraintKind::TrivialOfExactSize)
|
||||
kind != LayoutConstraintKind::TrivialOfExactSize &&
|
||||
kind != LayoutConstraintKind::TrivialStride)
|
||||
layout = LayoutConstraint::getLayoutConstraint(kind, ctx);
|
||||
else
|
||||
layout =
|
||||
|
||||
Reference in New Issue
Block a user