@@ -160,6 +160,7 @@ struct SILValuePrinterInfo {
160
160
Optional<ValueOwnershipKind> OwnershipKind;
161
161
bool IsNoImplicitCopy = false ;
162
162
LifetimeAnnotation Lifetime = LifetimeAnnotation::None;
163
+ bool IsCapture = false ;
163
164
164
165
SILValuePrinterInfo (ID ValueID) : ValueID(ValueID), Type(), OwnershipKind() {}
165
166
SILValuePrinterInfo (ID ValueID, SILType Type)
@@ -169,13 +170,15 @@ struct SILValuePrinterInfo {
169
170
: ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind) {}
170
171
SILValuePrinterInfo (ID ValueID, SILType Type,
171
172
ValueOwnershipKind OwnershipKind, bool IsNoImplicitCopy,
172
- LifetimeAnnotation Lifetime)
173
+ LifetimeAnnotation Lifetime, bool IsCapture )
173
174
: ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind),
174
- IsNoImplicitCopy (IsNoImplicitCopy), Lifetime(Lifetime) {}
175
+ IsNoImplicitCopy (IsNoImplicitCopy), Lifetime(Lifetime),
176
+ IsCapture(IsCapture) {}
175
177
SILValuePrinterInfo (ID ValueID, SILType Type, bool IsNoImplicitCopy,
176
- LifetimeAnnotation Lifetime)
178
+ LifetimeAnnotation Lifetime, bool IsCapture )
177
179
: ValueID(ValueID), Type(Type), OwnershipKind(),
178
- IsNoImplicitCopy(IsNoImplicitCopy), Lifetime(Lifetime) {}
180
+ IsNoImplicitCopy(IsNoImplicitCopy), Lifetime(Lifetime),
181
+ IsCapture(IsCapture) {}
179
182
};
180
183
181
184
// / Return the fully qualified dotted path for DeclContext.
@@ -659,6 +662,8 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
659
662
*this << " @_lexical " ;
660
663
break ;
661
664
}
665
+ if (i.IsCapture )
666
+ *this << " @closureCapture " ;
662
667
if (i.OwnershipKind && *i.OwnershipKind != OwnershipKind::None) {
663
668
*this << " @" << i.OwnershipKind .value () << " " ;
664
669
}
@@ -693,14 +698,18 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
693
698
}
694
699
SILValuePrinterInfo getIDAndType (SILFunctionArgument *arg) {
695
700
return {Ctx.getID (arg), arg->getType (), arg->isNoImplicitCopy (),
696
- arg->getLifetimeAnnotation ()};
701
+ arg->getLifetimeAnnotation (), arg-> isClosureCapture () };
697
702
}
698
703
SILValuePrinterInfo getIDAndTypeAndOwnership (SILValue V) {
699
704
return {Ctx.getID (V), V ? V->getType () : SILType (), V->getOwnershipKind ()};
700
705
}
701
706
SILValuePrinterInfo getIDAndTypeAndOwnership (SILFunctionArgument *arg) {
702
- return {Ctx.getID (arg), arg->getType (), arg->getOwnershipKind (),
703
- arg->isNoImplicitCopy (), arg->getLifetimeAnnotation ()};
707
+ return {Ctx.getID (arg),
708
+ arg->getType (),
709
+ arg->getOwnershipKind (),
710
+ arg->isNoImplicitCopy (),
711
+ arg->getLifetimeAnnotation (),
712
+ arg->isClosureCapture ()};
704
713
}
705
714
706
715
// ===--------------------------------------------------------------------===//
0 commit comments