Skip to content

Commit e32692d

Browse files
authored
Merge pull request #85014 from aviralg/aviralgoel/performance-hints/ensure-primary-source-file
[Performance Hints] Disable performance hints if typechecker can skip function bodies
2 parents 760a6fa + 6a3ca6d commit e32692d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/PerformanceHints.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
using namespace swift;
3232

3333
bool swift::performanceHintDiagnosticsEnabled(ASTContext &ctx) {
34-
return !ctx.Diags.isIgnoredDiagnosticGroupTree(DiagGroupID::PerformanceHints);
34+
return !ctx.Diags.isIgnoredDiagnosticGroupTree(DiagGroupID::PerformanceHints) &&
35+
(ctx.TypeCheckerOpts.SkipFunctionBodies == FunctionBodySkipping::None);
3536
}
3637

3738
namespace {

0 commit comments

Comments
 (0)