Skip to content

Commit c2adaa9

Browse files
committed
[field-pruned-liveness] Add helper for TypeSubElementCount that takes a SILFunction.
This just calls TypeSubElementCount(SILType, SILModule &, TypeExpansionContext) using the module and type expansion context from the SILFunction.
1 parent b81fc00 commit c2adaa9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/SIL/FieldSensitivePrunedLiveness.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ struct TypeSubElementCount {
196196
TypeSubElementCount(SILType type, SILModule &mod,
197197
TypeExpansionContext context);
198198

199+
/// Helper method that invokes the SILModule &mod entry point.
200+
TypeSubElementCount(SILType type, SILFunction *fn)
201+
: TypeSubElementCount(type, fn->getModule(), TypeExpansionContext(*fn)) {}
202+
199203
TypeSubElementCount(SILValue value)
200204
: TypeSubElementCount(value->getType(), *value->getModule(),
201205
TypeExpansionContext(*value->getFunction())) {}

0 commit comments

Comments
 (0)