@@ -1402,10 +1402,10 @@ namespace {
14021402 printField (PD->getDefaultArgumentKind (), " default_arg" );
14031403 }
14041404 if (PD->hasDefaultExpr () &&
1405- PD->getDefaultArgumentCaptureInfo (). hasBeenComputed () &&
1406- !PD->getDefaultArgumentCaptureInfo (). isTrivial ()) {
1405+ PD->getCachedDefaultArgumentCaptureInfo () &&
1406+ !PD->getCachedDefaultArgumentCaptureInfo ()-> isTrivial ()) {
14071407 printFieldRaw ([&](raw_ostream &OS) {
1408- PD->getDefaultArgumentCaptureInfo (). print (OS);
1408+ PD->getCachedDefaultArgumentCaptureInfo ()-> print (OS);
14091409 }, " " , CapturesColor);
14101410 }
14111411
@@ -1489,11 +1489,12 @@ namespace {
14891489
14901490 void printCommonAFD (AbstractFunctionDecl *D, const char *Type, StringRef Label) {
14911491 printCommon (D, Type, Label, FuncColor);
1492- if (D->getCaptureInfo ().hasBeenComputed () &&
1493- !D->getCaptureInfo ().isTrivial ()) {
1494- printFlagRaw ([&](raw_ostream &OS) {
1495- D->getCaptureInfo ().print (OS);
1496- });
1492+ if (auto captureInfo = D->getCachedCaptureInfo ()) {
1493+ if (!captureInfo->isTrivial ()) {
1494+ printFlagRaw ([&](raw_ostream &OS) {
1495+ captureInfo->print (OS);
1496+ });
1497+ }
14971498 }
14981499
14991500 if (auto *attr = D->getAttrs ().getAttribute <NonisolatedAttr>()) {
@@ -2828,11 +2829,12 @@ class PrintExpr : public ExprVisitor<PrintExpr, void, StringRef>,
28282829 break ;
28292830 }
28302831
2831- if (E->getCaptureInfo ().hasBeenComputed () &&
2832- !E->getCaptureInfo ().isTrivial ()) {
2833- printFieldRaw ([&](raw_ostream &OS) {
2834- E->getCaptureInfo ().print (OS);
2835- }, " " , CapturesColor);
2832+ if (auto captureInfo = E->getCachedCaptureInfo ()) {
2833+ if (!captureInfo->isTrivial ()) {
2834+ printFieldRaw ([&](raw_ostream &OS) {
2835+ captureInfo->print (OS);
2836+ }, " " , CapturesColor);
2837+ }
28362838 }
28372839 // Printing a function type doesn't indicate whether it's escaping because it doesn't
28382840 // matter in 99% of contexts. AbstractClosureExpr nodes are one of the only exceptions.
0 commit comments