Skip to content

Commit a97e47a

Browse files
authored
Merge pull request #33955 from vedantk/eng/PR-68759819
2 parents 7898f0b + ab817e8 commit a97e47a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/SILGen/SILGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,11 @@ void SILGenFunction::emitFunction(FuncDecl *fd) {
506506
MagicFunctionName = SILGenModule::getMagicFunctionName(fd);
507507

508508
auto captureInfo = SGM.M.Types.getLoweredLocalCaptures(SILDeclRef(fd));
509+
emitProfilerIncrement(fd->getTypecheckedBody());
509510
emitProlog(captureInfo, fd->getParameters(), fd->getImplicitSelfDecl(), fd,
510511
fd->getResultInterfaceType(), fd->hasThrows(), fd->getThrowsLoc());
511512
prepareEpilog(true, fd->hasThrows(), CleanupLocation(fd));
512513

513-
emitProfilerIncrement(fd->getTypecheckedBody());
514514
emitStmt(fd->getTypecheckedBody());
515515

516516
emitEpilog(fd);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sil -module-name coverage_non_constructible_enum %s | %FileCheck %s
2+
3+
// Reduced from Carthage (https://github.com/Carthage/Carthage).
4+
enum NoError: Error, Equatable {
5+
// CHECK-LABEL: static coverage_non_constructible_enum.NoError.== infix
6+
// CHECK: builtin "int_instrprof_increment"
7+
// CHECK: unreachable
8+
9+
// CHECK-LABEL: sil_coverage_map {{.*}} static coverage_non_constructible_enum.NoError.== infix
10+
// CHECK-NEXT: [[@LINE+1]]:54 -> [[@LINE+3]]:4 : 0
11+
static func ==(lhs: NoError, rhs: NoError) -> Bool {
12+
return true
13+
}
14+
}

0 commit comments

Comments
 (0)