@@ -160,6 +160,7 @@ struct SILValuePrinterInfo {
160160 Optional<ValueOwnershipKind> OwnershipKind;
161161 bool IsNoImplicitCopy = false ;
162162 LifetimeAnnotation Lifetime = LifetimeAnnotation::None;
163+ bool IsCapture = false ;
163164
164165 SILValuePrinterInfo (ID ValueID) : ValueID(ValueID), Type(), OwnershipKind() {}
165166 SILValuePrinterInfo (ID ValueID, SILType Type)
@@ -169,13 +170,15 @@ struct SILValuePrinterInfo {
169170 : ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind) {}
170171 SILValuePrinterInfo (ID ValueID, SILType Type,
171172 ValueOwnershipKind OwnershipKind, bool IsNoImplicitCopy,
172- LifetimeAnnotation Lifetime)
173+ LifetimeAnnotation Lifetime, bool IsCapture )
173174 : ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind),
174- IsNoImplicitCopy (IsNoImplicitCopy), Lifetime(Lifetime) {}
175+ IsNoImplicitCopy (IsNoImplicitCopy), Lifetime(Lifetime),
176+ IsCapture(IsCapture) {}
175177 SILValuePrinterInfo (ID ValueID, SILType Type, bool IsNoImplicitCopy,
176- LifetimeAnnotation Lifetime)
178+ LifetimeAnnotation Lifetime, bool IsCapture )
177179 : ValueID(ValueID), Type(Type), OwnershipKind(),
178- IsNoImplicitCopy(IsNoImplicitCopy), Lifetime(Lifetime) {}
180+ IsNoImplicitCopy(IsNoImplicitCopy), Lifetime(Lifetime),
181+ IsCapture(IsCapture) {}
179182};
180183
181184// / Return the fully qualified dotted path for DeclContext.
@@ -659,6 +662,8 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
659662 *this << " @_lexical " ;
660663 break ;
661664 }
665+ if (i.IsCapture )
666+ *this << " @closureCapture " ;
662667 if (i.OwnershipKind && *i.OwnershipKind != OwnershipKind::None) {
663668 *this << " @" << i.OwnershipKind .value () << " " ;
664669 }
@@ -693,14 +698,18 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
693698 }
694699 SILValuePrinterInfo getIDAndType (SILFunctionArgument *arg) {
695700 return {Ctx.getID (arg), arg->getType (), arg->isNoImplicitCopy (),
696- arg->getLifetimeAnnotation ()};
701+ arg->getLifetimeAnnotation (), arg-> isClosureCapture () };
697702 }
698703 SILValuePrinterInfo getIDAndTypeAndOwnership (SILValue V) {
699704 return {Ctx.getID (V), V ? V->getType () : SILType (), V->getOwnershipKind ()};
700705 }
701706 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 ()};
704713 }
705714
706715 // ===--------------------------------------------------------------------===//
0 commit comments