@@ -667,12 +667,12 @@ static void setUpForProfiling(SILDeclRef constant, SILFunction *F,
667
667
if (constant.hasDecl ()) {
668
668
if (auto *fd = constant.getFuncDecl ()) {
669
669
if (fd->hasBody ()) {
670
- F->createProfiler (fd, constant, forDefinition );
670
+ F->createProfiler (fd, constant);
671
671
profiledNode = fd->getBody (/* canSynthesize=*/ false );
672
672
}
673
673
}
674
674
} else if (auto *ace = constant.getAbstractClosureExpr ()) {
675
- F->createProfiler (ace, constant, forDefinition );
675
+ F->createProfiler (ace, constant);
676
676
profiledNode = ace;
677
677
}
678
678
// Set the function entry count for PGO.
@@ -914,7 +914,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
914
914
} else {
915
915
preEmitFunction (constant, f, decl);
916
916
PrettyStackTraceSILFunction X (" silgen emitConstructor" , f);
917
- f->createProfiler (decl, constant, ForDefinition );
917
+ f->createProfiler (decl, constant);
918
918
SILGenFunction (*this , *f, decl).emitValueConstructor (decl);
919
919
postEmitFunction (constant, f);
920
920
}
@@ -927,7 +927,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
927
927
928
928
preEmitFunction (constant, f, decl);
929
929
PrettyStackTraceSILFunction X (" silgen constructor initializer" , f);
930
- f->createProfiler (decl, constant, ForDefinition );
930
+ f->createProfiler (decl, constant);
931
931
SILGenFunction (*this , *f, decl).emitClassConstructorInitializer (decl);
932
932
postEmitFunction (constant, f);
933
933
break ;
@@ -993,7 +993,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
993
993
auto loc = RegularLocation::getAutoGeneratedLocation (init);
994
994
preEmitFunction (constant, f, loc);
995
995
PrettyStackTraceSILFunction X (" silgen emitStoredPropertyInitialization" , f);
996
- f->createProfiler (init, constant, ForDefinition );
996
+ f->createProfiler (init, constant);
997
997
SILGenFunction SGF (*this , *f, initDC);
998
998
999
999
// If this is a stored property initializer inside a type at global scope,
@@ -1020,8 +1020,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
1020
1020
" silgen emitPropertyWrapperBackingInitializer" , f);
1021
1021
auto wrapperInfo = var->getPropertyWrapperInitializerInfo ();
1022
1022
assert (wrapperInfo.hasInitFromWrappedValue ());
1023
- f->createProfiler (wrapperInfo.getInitFromWrappedValue (), constant,
1024
- ForDefinition);
1023
+ f->createProfiler (wrapperInfo.getInitFromWrappedValue (), constant);
1025
1024
auto varDC = var->getInnermostDeclContext ();
1026
1025
SILGenFunction SGF (*this , *f, varDC);
1027
1026
SGF.emitGeneratorFunction (constant, wrapperInfo.getInitFromWrappedValue ());
@@ -1038,8 +1037,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
1038
1037
" silgen emitPropertyWrapperInitFromProjectedValue" , f);
1039
1038
auto initInfo = var->getPropertyWrapperInitializerInfo ();
1040
1039
assert (initInfo.hasInitFromProjectedValue ());
1041
- f->createProfiler (initInfo.getInitFromProjectedValue (), constant,
1042
- ForDefinition);
1040
+ f->createProfiler (initInfo.getInitFromProjectedValue (), constant);
1043
1041
auto varDC = var->getInnermostDeclContext ();
1044
1042
SILGenFunction SGF (*this , *f, varDC);
1045
1043
SGF.emitGeneratorFunction (constant, initInfo.getInitFromProjectedValue ());
@@ -1079,7 +1077,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
1079
1077
auto *dd = cast<DestructorDecl>(constant.getDecl ());
1080
1078
preEmitFunction (constant, f, dd);
1081
1079
PrettyStackTraceSILFunction X (" silgen emitDestroyingDestructor" , f);
1082
- f->createProfiler (dd, constant, ForDefinition );
1080
+ f->createProfiler (dd, constant);
1083
1081
SILGenFunction (*this , *f, dd).emitDestroyingDestructor (dd);
1084
1082
postEmitFunction (constant, f);
1085
1083
return ;
@@ -1092,7 +1090,7 @@ void SILGenModule::emitFunctionDefinition(SILDeclRef constant, SILFunction *f) {
1092
1090
if (usesObjCAllocator (cd)) {
1093
1091
preEmitFunction (constant, f, dd);
1094
1092
PrettyStackTraceSILFunction X (" silgen emitDestructor -dealloc" , f);
1095
- f->createProfiler (dd, constant, ForDefinition );
1093
+ f->createProfiler (dd, constant);
1096
1094
SILGenFunction (*this , *f, dd).emitObjCDestructor (constant);
1097
1095
postEmitFunction (constant, f);
1098
1096
return ;
@@ -1461,8 +1459,6 @@ void SILGenModule::emitConstructor(ConstructorDecl *decl) {
1461
1459
SILDeclRef constant (decl);
1462
1460
DeclContext *declCtx = decl->getDeclContext ();
1463
1461
1464
- bool ForCoverageMapping = doesASTRequireProfiling (M, decl);
1465
-
1466
1462
if (declCtx->getSelfClassDecl ()) {
1467
1463
// Designated initializers for classes, as well as @objc convenience
1468
1464
// initializers, have have separate entry points for allocation and
@@ -1472,8 +1468,7 @@ void SILGenModule::emitConstructor(ConstructorDecl *decl) {
1472
1468
1473
1469
if (decl->hasBody ()) {
1474
1470
SILDeclRef initConstant (decl, SILDeclRef::Kind::Initializer);
1475
- emitOrDelayFunction (*this , initConstant,
1476
- /* forceEmission=*/ ForCoverageMapping);
1471
+ emitOrDelayFunction (*this , initConstant);
1477
1472
}
1478
1473
1479
1474
return ;
@@ -1954,7 +1949,7 @@ void SILGenModule::visitTopLevelCodeDecl(TopLevelCodeDecl *td) {
1954
1949
// A single SILFunction may be used to lower multiple top-level decls. When
1955
1950
// this happens, fresh profile counters must be assigned to the new decl.
1956
1951
TopLevelSGF->F .discardProfiler ();
1957
- TopLevelSGF->F .createProfiler (td, SILDeclRef (), ForDefinition );
1952
+ TopLevelSGF->F .createProfiler (td, SILDeclRef ());
1958
1953
1959
1954
TopLevelSGF->emitProfilerIncrement (td->getBody ());
1960
1955
0 commit comments