Skip to content

Commit fd192f4

Browse files
authored
Merge pull request #29657 from hborla/5.2-warn-long-function-bodies
[5.2][FunctionBodyTimer] Fix `-warn-long-function-bodies`, whose behavior was
2 parents 1434698 + 0392ad0 commit fd192f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ namespace {
198198
ASTContext &ctx = Function.getAsDeclContext()->getASTContext();
199199
auto *AFD = Function.getAbstractFunctionDecl();
200200

201-
if (ctx.TypeCheckerOpts.WarnLongFunctionBodies) {
201+
if (ctx.TypeCheckerOpts.DebugTimeFunctionBodies) {
202202
// Round up to the nearest 100th of a millisecond.
203203
llvm::errs() << llvm::format("%0.2f", ceil(elapsed * 100000) / 100) << "ms\t";
204204
Function.getLoc().print(llvm::errs(), ctx.SourceMgr);
@@ -213,7 +213,7 @@ namespace {
213213
llvm::errs() << "\n";
214214
}
215215

216-
const auto WarnLimit = ctx.TypeCheckerOpts.DebugTimeFunctionBodies;
216+
const auto WarnLimit = ctx.TypeCheckerOpts.WarnLongFunctionBodies;
217217
if (WarnLimit != 0 && elapsedMS >= WarnLimit) {
218218
if (AFD) {
219219
ctx.Diags.diagnose(AFD, diag::debug_long_function_body,

0 commit comments

Comments
 (0)