mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Profiler] Increment function body count prior to the prolog
This fixes another 'SILBuilder has no valid insertion point' assertion failure seen when compiling Carthage. rdar://68759819
This commit is contained in:
@@ -506,11 +506,11 @@ void SILGenFunction::emitFunction(FuncDecl *fd) {
|
||||
MagicFunctionName = SILGenModule::getMagicFunctionName(fd);
|
||||
|
||||
auto captureInfo = SGM.M.Types.getLoweredLocalCaptures(SILDeclRef(fd));
|
||||
emitProfilerIncrement(fd->getTypecheckedBody());
|
||||
emitProlog(captureInfo, fd->getParameters(), fd->getImplicitSelfDecl(), fd,
|
||||
fd->getResultInterfaceType(), fd->hasThrows(), fd->getThrowsLoc());
|
||||
prepareEpilog(true, fd->hasThrows(), CleanupLocation(fd));
|
||||
|
||||
emitProfilerIncrement(fd->getTypecheckedBody());
|
||||
emitStmt(fd->getTypecheckedBody());
|
||||
|
||||
emitEpilog(fd);
|
||||
|
||||
Reference in New Issue
Block a user