Skip to content

Commit 0f3246b

Browse files
author
z1_cciauto
authored
merge main into amd-staging (llvm#3940)
2 parents 10de30d + 641921a commit 0f3246b

File tree

206 files changed

+3892
-1714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+3892
-1714
lines changed

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Checks: >
2222
readability-*,
2323
-readability-avoid-nested-conditional-operator,
2424
-readability-braces-around-statements,
25-
-readability-container-contains,
2625
-readability-convert-member-functions-to-static,
2726
-readability-else-after-return,
2827
-readability-function-cognitive-complexity,

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ExpandModularHeadersPPCallbacks::FileRecorder {
3535
const SrcMgr::ContentCache &ContentCache,
3636
llvm::vfs::InMemoryFileSystem &InMemoryFs) {
3737
// Return if we are not interested in the contents of this file.
38-
if (!FilesToRecord.count(File))
38+
if (!FilesToRecord.contains(File))
3939
return;
4040

4141
// FIXME: Why is this happening? We might be losing contents here.

clang-tools-extra/clang-tidy/NoLintDirectiveHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ bool NoLintDirectiveHandler::Impl::diagHasNoLint(
349349
return false;
350350

351351
// Do we have cached NOLINT block locations for this file?
352-
if (Cache.count(*FileName) == 0)
352+
if (!Cache.contains(*FileName))
353353
// Warning: heavy operation - need to read entire file.
354354
generateCache(SrcMgr, *FileName, File, *Buffer, NoLintErrors);
355355

clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void UpgradeDurationConversionsCheck::check(
126126

127127
if (!match(isInTemplateInstantiation(), *OuterExpr, *Result.Context)
128128
.empty()) {
129-
if (MatchedTemplateLocations.count(Loc) == 0) {
129+
if (!MatchedTemplateLocations.contains(Loc)) {
130130
// For each location matched in a template instantiation, we check if the
131131
// location can also be found in `MatchedTemplateLocations`. If it is not
132132
// found, that means the expression did not create a match without the

clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ bool SignalHandlerCheck::isStandardFunctionAsyncSafe(
525525
if (!FD->isInStdNamespace() && !FD->isGlobal())
526526
return false;
527527

528-
if (ConformingFunctions.count(II->getName()))
528+
if (ConformingFunctions.contains(II->getName()))
529529
return true;
530530

531531
return false;

clang-tools-extra/clang-tidy/bugprone/SwappedArgumentsCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void SwappedArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
9191

9292
// Only need to check RHS, as LHS has already been covered. We don't want to
9393
// emit two warnings for a single argument.
94-
if (UsedArgs.count(RHS))
94+
if (UsedArgs.contains(RHS))
9595
continue;
9696

9797
const auto *LHSCast = dyn_cast<ImplicitCastExpr>(ignoreNoOpCasts(LHS));

clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ UseAfterMoveFinder::find(Stmt *CodeBlock, const Expr *MovingCall,
148148
std::optional<UseAfterMove>
149149
UseAfterMoveFinder::findInternal(const CFGBlock *Block, const Expr *MovingCall,
150150
const ValueDecl *MovedVariable) {
151-
if (Visited.count(Block))
151+
if (Visited.contains(Block))
152152
return std::nullopt;
153153

154154
// Mark the block as visited (except if this is the block containing the
@@ -232,7 +232,7 @@ void UseAfterMoveFinder::getUsesAndReinits(
232232
// All references to the variable that aren't reinitializations are uses.
233233
Uses->clear();
234234
for (const DeclRefExpr *DeclRef : DeclRefs) {
235-
if (!ReinitDeclRefs.count(DeclRef))
235+
if (!ReinitDeclRefs.contains(DeclRef))
236236
Uses->push_back(DeclRef);
237237
}
238238

clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ toCommaSeparatedString(const R &OrderedDecls,
9999
const SmallPtrSetImpl<const T *> &DeclsToInit) {
100100
SmallVector<StringRef, 16> Names;
101101
for (const T *Decl : OrderedDecls) {
102-
if (DeclsToInit.count(Decl))
102+
if (DeclsToInit.contains(Decl))
103103
Names.emplace_back(getName(Decl));
104104
}
105105
return llvm::join(Names.begin(), Names.end(), ", ");
@@ -501,7 +501,7 @@ void ProTypeMemberInitCheck::checkMissingMemberInitializer(
501501
AnyMemberHasInitPerUnion = false;
502502
forEachFieldWithFilter(ClassDecl, ClassDecl.fields(),
503503
AnyMemberHasInitPerUnion, [&](const FieldDecl *F) {
504-
if (!FieldsToInit.count(F))
504+
if (!FieldsToInit.contains(F))
505505
return;
506506
// Don't suggest fixes for enums because we don't
507507
// know a good default. Don't suggest fixes for

clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void UpgradeGoogletestCaseCheck::check(const MatchFinder::MatchResult &Result) {
308308
}
309309

310310
if (IsInInstantiation) {
311-
if (MatchedTemplateLocations.count(ReplacementRange.getBegin()) == 0) {
311+
if (!MatchedTemplateLocations.contains(ReplacementRange.getBegin())) {
312312
// For each location matched in a template instantiation, we check if
313313
// the location can also be found in `MatchedTemplateLocations`. If it
314314
// is not found, that means the expression did not create a match

clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ static bool emitCapture(llvm::StringSet<> &CaptureSet, StringRef Delimiter,
585585
return false;
586586

587587
// This capture has already been emitted.
588-
if (CaptureSet.count(Identifier) != 0)
588+
if (CaptureSet.contains(Identifier))
589589
return false;
590590

591591
Stream << Delimiter;

0 commit comments

Comments
 (0)