Skip to content

Commit 79cbb2e

Browse files
committed
[NFC] Add a convenience function to drill through SIL pack types
1 parent a37146c commit 79cbb2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/swift/SIL/SILType.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,13 @@ class SILType {
537537
return SILType(castTo<TupleType>().getElementType(index), getCategory());
538538
}
539539

540+
/// Given that this is a pack type, return the lowered type of the
541+
/// given pack element. The result will have the same value
542+
/// category as the base type.
543+
SILType getPackElementType(unsigned index) const {
544+
return SILType(castTo<SILPackType>()->getElementType(index), getCategory());
545+
}
546+
540547
/// Given that this is a pack expansion type, return the lowered type
541548
/// of the pattern type. The result will have the same value category
542549
/// as the base type.

0 commit comments

Comments
 (0)