Skip to content

Commit 2b562b4

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents 6406fb6 + 0014b49 commit 2b562b4

File tree

371 files changed

+16408
-3156
lines changed

Some content is hidden

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

371 files changed

+16408
-3156
lines changed

bolt/lib/Core/BinaryBasicBlock.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ void BinaryBasicBlock::updateJumpTableSuccessors() {
372372
[](const BinaryBasicBlock *BB1, const BinaryBasicBlock *BB2) {
373373
return BB1->getInputOffset() < BB2->getInputOffset();
374374
});
375-
SuccessorBBs.erase(std::unique(SuccessorBBs.begin(), SuccessorBBs.end()),
376-
SuccessorBBs.end());
375+
SuccessorBBs.erase(llvm::unique(SuccessorBBs), SuccessorBBs.end());
377376

378377
for (BinaryBasicBlock *BB : SuccessorBBs)
379378
addSuccessor(BB);

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,7 @@ Error BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
23762376
// Without doing jump table value profiling we don't have a use for extra
23772377
// (duplicate) branches.
23782378
llvm::sort(TakenBranches);
2379-
auto NewEnd = std::unique(TakenBranches.begin(), TakenBranches.end());
2379+
auto NewEnd = llvm::unique(TakenBranches);
23802380
TakenBranches.erase(NewEnd, TakenBranches.end());
23812381

23822382
for (std::pair<uint32_t, uint32_t> &Branch : TakenBranches) {

bolt/lib/Core/DebugNames.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,7 @@ void DWARF5AcceleratorTable::computeBucketCount() {
440440
for (const auto &E : Entries)
441441
Uniques.push_back(E.second.HashValue);
442442
array_pod_sort(Uniques.begin(), Uniques.end());
443-
std::vector<uint32_t>::iterator P =
444-
std::unique(Uniques.begin(), Uniques.end());
443+
std::vector<uint32_t>::iterator P = llvm::unique(Uniques);
445444

446445
UniqueHashCount = std::distance(Uniques.begin(), P);
447446

bolt/lib/Profile/YAMLProfileWriter.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,9 @@ std::vector<yaml::bolt::PseudoProbeInfo>
133133
YAMLProfileWriter::convertNodeProbes(NodeIdToProbes &NodeProbes) {
134134
struct BlockProbeInfoHasher {
135135
size_t operator()(const yaml::bolt::PseudoProbeInfo &BPI) const {
136-
auto HashCombine = [](auto &Range) {
137-
return llvm::hash_combine_range(Range.begin(), Range.end());
138-
};
139-
return llvm::hash_combine(HashCombine(BPI.BlockProbes),
140-
HashCombine(BPI.CallProbes),
141-
HashCombine(BPI.IndCallProbes));
136+
return llvm::hash_combine(llvm::hash_combine_range(BPI.BlockProbes),
137+
llvm::hash_combine_range(BPI.CallProbes),
138+
llvm::hash_combine_range(BPI.IndCallProbes));
142139
}
143140
};
144141

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void Info::mergeBase(Info &&Other) {
200200
std::move(Other.Description.begin(), Other.Description.end(),
201201
std::back_inserter(Description));
202202
llvm::sort(Description);
203-
auto Last = std::unique(Description.begin(), Description.end());
203+
auto Last = llvm::unique(Description);
204204
Description.erase(Last, Description.end());
205205
}
206206

@@ -215,7 +215,7 @@ void SymbolInfo::merge(SymbolInfo &&Other) {
215215
// Unconditionally extend the list of locations, since we want all of them.
216216
std::move(Other.Loc.begin(), Other.Loc.end(), std::back_inserter(Loc));
217217
llvm::sort(Loc);
218-
auto *Last = std::unique(Loc.begin(), Loc.end());
218+
auto *Last = llvm::unique(Loc);
219219
Loc.erase(Last, Loc.end());
220220
mergeBase(std::move(Other));
221221
}

clang-tools-extra/clang-include-fixer/IncludeFixerContext.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ IncludeFixerContext::IncludeFixerContext(
9090
std::make_pair(B.Range.getOffset(), B.Range.getLength());
9191
});
9292
QuerySymbolInfos.erase(
93-
std::unique(QuerySymbolInfos.begin(), QuerySymbolInfos.end(),
94-
[](const QuerySymbolInfo &A, const QuerySymbolInfo &B) {
95-
return A.Range == B.Range;
96-
}),
93+
llvm::unique(QuerySymbolInfos,
94+
[](const QuerySymbolInfo &A, const QuerySymbolInfo &B) {
95+
return A.Range == B.Range;
96+
}),
9797
QuerySymbolInfos.end());
9898
for (const auto &Symbol : MatchedSymbols) {
9999
HeaderInfos.push_back(
@@ -103,11 +103,11 @@ IncludeFixerContext::IncludeFixerContext(
103103
QuerySymbolInfos.front().ScopedQualifiers, Symbol)});
104104
}
105105
// Deduplicate header infos.
106-
HeaderInfos.erase(std::unique(HeaderInfos.begin(), HeaderInfos.end(),
107-
[](const HeaderInfo &A, const HeaderInfo &B) {
108-
return A.Header == B.Header &&
109-
A.QualifiedName == B.QualifiedName;
110-
}),
106+
HeaderInfos.erase(llvm::unique(HeaderInfos,
107+
[](const HeaderInfo &A, const HeaderInfo &B) {
108+
return A.Header == B.Header &&
109+
A.QualifiedName == B.QualifiedName;
110+
}),
111111
HeaderInfos.end());
112112
}
113113

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,7 @@ std::vector<ClangTidyError> ClangTidyDiagnosticConsumer::take() {
754754
finalizeLastError();
755755

756756
llvm::stable_sort(Errors, LessClangTidyError());
757-
Errors.erase(std::unique(Errors.begin(), Errors.end(), EqualClangTidyError()),
758-
Errors.end());
757+
Errors.erase(llvm::unique(Errors, EqualClangTidyError()), Errors.end());
759758
if (RemoveIncompatibleErrors)
760759
removeIncompatibleErrors();
761760
return std::move(Errors);

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ using namespace ::clang::transformer;
2121

2222
namespace clang::tidy::abseil {
2323

24-
RewriteRuleWith<std::string> CleanupCtadCheckImpl() {
25-
auto warning_message = cat("prefer absl::Cleanup's class template argument "
26-
"deduction pattern in C++17 and higher");
24+
RewriteRuleWith<std::string> cleanupCtadCheckImpl() {
25+
auto WarningMessage = cat("prefer absl::Cleanup's class template argument "
26+
"deduction pattern in C++17 and higher");
2727

2828
return makeRule(
2929
declStmt(hasSingleDecl(varDecl(
@@ -34,10 +34,10 @@ RewriteRuleWith<std::string> CleanupCtadCheckImpl() {
3434
.bind("make_cleanup_call")))))),
3535
{changeTo(node("auto_type_loc"), cat("absl::Cleanup")),
3636
changeTo(node("make_cleanup_call"), cat(callArgs("make_cleanup_call")))},
37-
warning_message);
37+
WarningMessage);
3838
}
3939

4040
CleanupCtadCheck::CleanupCtadCheck(StringRef Name, ClangTidyContext *Context)
41-
: utils::TransformerClangTidyCheck(CleanupCtadCheckImpl(), Name, Context) {}
41+
: utils::TransformerClangTidyCheck(cleanupCtadCheckImpl(), Name, Context) {}
4242

4343
} // namespace clang::tidy::abseil

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ static bool isIdenticalStmt(const ASTContext &Ctx, const Stmt *Stmt1,
250250

251251
if (!llvm::all_of(llvm::zip(CompStmt1->body(), CompStmt2->body()),
252252
[&Ctx, IgnoreSideEffects](
253-
std::tuple<const Stmt *, const Stmt *> stmtPair) {
254-
const Stmt *stmt0 = std::get<0>(stmtPair);
255-
const Stmt *stmt1 = std::get<1>(stmtPair);
256-
return isIdenticalStmt(Ctx, stmt0, stmt1,
253+
std::tuple<const Stmt *, const Stmt *> StmtPair) {
254+
const Stmt *Stmt0 = std::get<0>(StmtPair);
255+
const Stmt *Stmt1 = std::get<1>(StmtPair);
256+
return isIdenticalStmt(Ctx, Stmt0, Stmt1,
257257
IgnoreSideEffects);
258258
})) {
259259
return false;
@@ -477,7 +477,7 @@ void BranchCloneCheck::check(const MatchFinder::MatchResult &Result) {
477477

478478
if (const auto *IS = Result.Nodes.getNodeAs<IfStmt>("ifWithDescendantIf")) {
479479
const Stmt *Then = IS->getThen();
480-
auto CS = dyn_cast<CompoundStmt>(Then);
480+
const auto *CS = dyn_cast<CompoundStmt>(Then);
481481
if (CS && (!CS->body_empty())) {
482482
const auto *InnerIf = dyn_cast<IfStmt>(*CS->body_begin());
483483
if (InnerIf && isIdenticalStmt(Context, IS->getCond(), InnerIf->getCond(),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ bool isCXXOnlyStmt(const Stmt *S) {
301301
/// It is unspecified which call is found if multiple calls exist, but the order
302302
/// should be deterministic (depend only on the AST).
303303
Expr *findCallExpr(const CallGraphNode *Caller, const CallGraphNode *Callee) {
304-
auto FoundCallee = llvm::find_if(
304+
const auto *FoundCallee = llvm::find_if(
305305
Caller->callees(), [Callee](const CallGraphNode::CallRecord &Call) {
306306
return Call.Callee == Callee;
307307
});

0 commit comments

Comments
 (0)