-
Notifications
You must be signed in to change notification settings - Fork 15.1k
tidy #95384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
tidy #95384
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
@llvm/pr-subscribers-clang-tidy @llvm/pr-subscribers-clang-tools-extra Author: Congcong Cai (HerrCai0907) Changes
Full diff: https://github.com/llvm/llvm-project/pull/95384.diff 1 Files Affected:
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);
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
target .. private(..)toomp.privateops ([flang][OpenMP] Lowertarget .. private(..)toomp.privateops #94195)hasConflict()assertions ([KnownBits] RemovehasConflict()assertions #94568)shared_ptrAtomic Access APIs as per P0… #92920)--openmp-enable-delayed-privatization-stagingflag ([flang][OpenMP] Add--openmp-enable-delayed-privatization-stagingflag #94749)prettyPrintBaseTypeRef. ([llvm-dwarfdump] Add a null-check inprettyPrintBaseTypeRef. #93156)(icmp eq/ne (xor x, C0), C1); NFC(icmp eq/ne (xor x, y), C1)even if multiuseLoopLikeOpInterface([mlir][loops] Add getters for multi dim loop variables inLoopLikeOpInterface#94516).relr.auth.dynsection" (Revert "[lld][AArch64][ELF][PAC] Support.relr.auth.dynsection" #94843)llvm::sizeingetLoopPreheader([Support] Do not usellvm::sizeingetLoopPreheader#94540)GreedyPatternRewriteDriver: Use composition instead of inheritance ([mlir][Transforms][NFC]GreedyPatternRewriteDriver: Use composition instead of inheritance #92785)__promote([libc++][NFC] Simplify the implementation of__promote#81379)addcprefetchainstructionInstCombinerImpl::foldICmpShlConstant([InstCombine] Fix missing argument typo inInstCombinerImpl::foldICmpShlConstant#94899)doesNotMutateObject: Handle calls to member functions … ([clang-tidy]doesNotMutateObject: Handle calls to member functions … #94362)LLVM_ENABLE_ABI_BREAKING_CHECKScorrectly ([Misc] UseLLVM_ENABLE_ABI_BREAKING_CHECKScorrectly #94212)getDirectiveCategoryfor ACC/OMP directives ([Frontend] IntroducegetDirectiveCategoryfor ACC/OMP directives #94689)-Wunused-variablewarnings in mutex tests ([libc++][test] Avoid-Wunused-variablewarnings in mutex tests #94907)LLVM_ENABLE_ABI_BREAKING_CHECKScorrectly ([Misc] UseLLVM_ENABLE_ABI_BREAKING_CHECKScorrectly #94212)LLVM_ENABLE_ABI_BREAKING_CHECKScorrectly" (Revert "[Misc] UseLLVM_ENABLE_ABI_BREAKING_CHECKScorrectly" #94982)ldexp(x, zext(i1 y))tofmul x, (select y, 2.0, 1.0)([InstCombine] foldldexp(x, zext(i1 y))tofmul x, (select y, 2.0, 1.0)#94887)sparse_tensor.iterateoperation ([mlir][sparse] introducesparse_tensor.iterateoperation #88955)StopInfoMachException::DeterminePtrauthFailure(NFC) ([lldb] Tighten ABI assert inStopInfoMachException::DeterminePtrauthFailure(NFC) #95015)(icmp eq/ne (and X, P2), (and X, -P2)); NFC(icmp eq/ne (and Z, X), (and Z, Y))foldsdllexportfor exported template specialization ([clang] Fix loss ofdllexportfor exported template specialization #94664)handleSelectLikeInst([NFC][msan] ExtracthandleSelectLikeInst#94881)inline-switch-default.ll(NFC) ([Inliner][test] Fix incorrect REQUIRE line ininline-switch-default.ll(NFC) #95009)AtomicExprinResultObjectVisitor. ([clang][dataflow] HandleAtomicExprinResultObjectVisitor. #94963)getReferencedDecls(). ([clang][nullability] Don't return null fields fromgetReferencedDecls(). #94983)MachineDominatorTreeinto a concrete analysis result ([CodeGen][NewPM] SplitMachineDominatorTreeinto a concrete analysis result #94571)