@@ -234,6 +234,9 @@ static AccessorDecl *createGetterPrototype(AbstractStorageDecl *storage,
234
234
// Always add the getter to the context immediately after the storage.
235
235
addMemberToContextIfNeeded (getter, storage->getDeclContext (), storage);
236
236
237
+ if (ctx.Stats )
238
+ ctx.Stats ->getFrontendCounters ().NumAccessorsSynthesized ++;
239
+
237
240
return getter;
238
241
}
239
242
@@ -285,6 +288,9 @@ static AccessorDecl *createSetterPrototype(AbstractStorageDecl *storage,
285
288
assert (getter && " always synthesize setter prototype after get/read" );
286
289
addMemberToContextIfNeeded (setter, storage->getDeclContext (), getter);
287
290
291
+ if (ctx.Stats )
292
+ ctx.Stats ->getFrontendCounters ().NumAccessorsSynthesized ++;
293
+
288
294
return setter;
289
295
}
290
296
@@ -483,6 +489,9 @@ createCoroutineAccessorPrototype(AbstractStorageDecl *storage,
483
489
484
490
addMemberToContextIfNeeded (accessor, dc, afterDecl);
485
491
492
+ if (ctx.Stats )
493
+ ctx.Stats ->getFrontendCounters ().NumAccessorsSynthesized ++;
494
+
486
495
return accessor;
487
496
}
488
497
@@ -2275,6 +2284,9 @@ synthesizeAccessorBody(AbstractFunctionDecl *fn, void *) {
2275
2284
auto *accessor = cast<AccessorDecl>(fn);
2276
2285
auto &ctx = accessor->getASTContext ();
2277
2286
2287
+ if (ctx.Stats )
2288
+ ctx.Stats ->getFrontendCounters ().NumAccessorBodiesSynthesized ++;
2289
+
2278
2290
if (accessor->isInvalid () || ctx.hadError ())
2279
2291
return { nullptr , true };
2280
2292
0 commit comments