[clang-tools-extra] 3f9e2e1 - [NFC][clang-tidy] fix typo in readability-else-after-return
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 13 03:24:43 PDT 2024
Author: Congcong Cai
Date: 2024-06-13T18:24:12+08:00
New Revision: 3f9e2e179a52eb50a2bcff148a5f351a4eddcb37
URL: https://github.com/llvm/llvm-project/commit/3f9e2e179a52eb50a2bcff148a5f351a4eddcb37
DIFF: https://github.com/llvm/llvm-project/commit/3f9e2e179a52eb50a2bcff148a5f351a4eddcb37.diff
LOG: [NFC][clang-tidy] fix typo in readability-else-after-return
Added:
Modified:
clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp b/clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
index 2b185e7594add..f68e1f6926b84 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<CXXThrowExpr>(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);
}
More information about the cfe-commits
mailing list