From 399e1e2ade0630949d5b38fc9f82dcf478c4d6c3 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 13 Jun 2024 18:12:02 +0800 Subject: [PATCH] [NFC][clang-tidy] fix typo in readability-else-after-return --- .../readability/ElseAfterReturnCheck.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp b/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp index 2b185e7594addc..f68e1f6926b84b 100644 --- a/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp @@ -231,7 +231,7 @@ static StringRef getControlFlowString(const Stmt &Stmt) { return "break"; if (isa(Stmt)) return "throw"; - llvm_unreachable("Unknown control flow interruptor"); + llvm_unreachable("Unknown control flow interrupter"); } void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { @@ -247,12 +247,12 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { return; bool IsLastInScope = OuterScope->body_back() == If; - StringRef ControlFlowInterruptor = getControlFlowString(*Interrupt); + const StringRef ControlFlowInterrupter = getControlFlowString(*Interrupt); if (!IsLastInScope && containsDeclInScope(Else)) { if (WarnOnUnfixable) { // Warn, but don't attempt an autofix. - diag(ElseLoc, WarningMessage) << ControlFlowInterruptor; + diag(ElseLoc, WarningMessage) << ControlFlowInterrupter; } return; } @@ -264,7 +264,7 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { // If the if statement is the last statement of its enclosing statements // scope, we can pull the decl out of the if statement. DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage) - << ControlFlowInterruptor + << ControlFlowInterrupter << SourceRange(ElseLoc); if (checkInitDeclUsageInElse(If) != nullptr) { Diag << tooling::fixit::createReplacement( @@ -288,7 +288,7 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc); } else if (WarnOnUnfixable) { // Warn, but don't attempt an autofix. - diag(ElseLoc, WarningMessage) << ControlFlowInterruptor; + diag(ElseLoc, WarningMessage) << ControlFlowInterrupter; } return; } @@ -300,7 +300,7 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { // If the if statement is the last statement of its enclosing statements // scope, we can pull the decl out of the if statement. DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage) - << ControlFlowInterruptor + << ControlFlowInterrupter << SourceRange(ElseLoc); Diag << tooling::fixit::createReplacement( SourceRange(If->getIfLoc()), @@ -312,13 +312,13 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) { removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc); } else if (WarnOnUnfixable) { // Warn, but don't attempt an autofix. - diag(ElseLoc, WarningMessage) << ControlFlowInterruptor; + diag(ElseLoc, WarningMessage) << ControlFlowInterrupter; } return; } DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage) - << ControlFlowInterruptor << SourceRange(ElseLoc); + << ControlFlowInterrupter << SourceRange(ElseLoc); removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc); }