Skip to content

Commit 4618e90

Browse files
committed
Merge from 'main' to 'sycl-web' (18 commits)
2 parents c04a9cb + 9905dae commit 4618e90

File tree

123 files changed

+2423
-960
lines changed

Some content is hidden

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

123 files changed

+2423
-960
lines changed

bolt/include/bolt/Core/BinaryBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ class BinaryBasicBlock {
985985
#if defined(LLVM_ON_UNIX)
986986
/// Keep the size of the BinaryBasicBlock within a reasonable size class
987987
/// (jemalloc bucket) on Linux
988-
static_assert(sizeof(BinaryBasicBlock) <= 256, "");
988+
static_assert(sizeof(BinaryBasicBlock) <= 256);
989989
#endif
990990

991991
bool operator<(const BinaryBasicBlock &LHS, const BinaryBasicBlock &RHS);

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4419,12 +4419,14 @@ void BinaryFunction::printLoopInfo(raw_ostream &OS) const {
44194419
OS << "\n";
44204420

44214421
std::stack<BinaryLoop *> St;
4422-
for_each(*BLI, [&](BinaryLoop *L) { St.push(L); });
4422+
for (BinaryLoop *L : *BLI)
4423+
St.push(L);
44234424
while (!St.empty()) {
44244425
BinaryLoop *L = St.top();
44254426
St.pop();
44264427

4427-
for_each(*L, [&](BinaryLoop *Inner) { St.push(Inner); });
4428+
for (BinaryLoop *Inner : *L)
4429+
St.push(Inner);
44284430

44294431
if (!hasValidProfile())
44304432
continue;

bolt/lib/Core/DebugData.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,11 +1183,9 @@ void DebugAbbrevWriter::addUnitAbbreviations(DWARFUnit &Unit) {
11831183
// FIXME: if we had a full access to DWARFDebugAbbrev::AbbrDeclSets
11841184
// we wouldn't have to build our own sorted list for the quick lookup.
11851185
if (AbbrevSetOffsets.empty()) {
1186-
for_each(
1187-
*Unit.getContext().getDebugAbbrev(),
1188-
[&](const std::pair<uint64_t, DWARFAbbreviationDeclarationSet> &P) {
1189-
AbbrevSetOffsets.push_back(P.first);
1190-
});
1186+
for (const std::pair<const uint64_t, DWARFAbbreviationDeclarationSet>
1187+
&P : *Unit.getContext().getDebugAbbrev())
1188+
AbbrevSetOffsets.push_back(P.first);
11911189
sort(AbbrevSetOffsets);
11921190
}
11931191
auto It = upper_bound(AbbrevSetOffsets, StartOffset);

bolt/lib/Core/FunctionLayout.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ void FunctionLayout::eraseBasicBlocks(
151151
};
152152
const FragmentListType::iterator EmptyTailBegin =
153153
llvm::find_if_not(reverse(Fragments), IsEmpty).base();
154-
std::for_each(EmptyTailBegin, Fragments.end(),
155-
[](FunctionFragment *const FF) { delete FF; });
154+
for (FunctionFragment *const FF :
155+
llvm::make_range(EmptyTailBegin, Fragments.end()))
156+
delete FF;
156157
Fragments.erase(EmptyTailBegin, Fragments.end());
157158

158159
updateLayoutIndices();
@@ -208,8 +209,8 @@ void FunctionLayout::clear() {
208209
// be written to the output stream at its original file offset (see
209210
// `RewriteInstance::rewriteFile`). Hence, when the layout is cleared, retain
210211
// the main fragment, so that this information is not lost.
211-
std::for_each(Fragments.begin() + 1, Fragments.end(),
212-
[](FunctionFragment *const FF) { delete FF; });
212+
for (FunctionFragment *const FF : llvm::drop_begin(Fragments))
213+
delete FF;
213214
Fragments = FragmentListType{Fragments.front()};
214215
getMainFragment().Size = 0;
215216
}

bolt/lib/Passes/FrameOptimizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ void FrameOptimizerPass::performShrinkWrapping(const RegAnalysis &RA,
336336

337337
std::vector<std::pair<uint64_t, const BinaryFunction *>> Top10Funcs;
338338
auto LogFunc = [&](BinaryFunction &BF) {
339-
auto Lower = std::lower_bound(
340-
Top10Funcs.begin(), Top10Funcs.end(), BF.getKnownExecutionCount(),
339+
auto Lower = llvm::lower_bound(
340+
Top10Funcs, BF.getKnownExecutionCount(),
341341
[](const std::pair<uint64_t, const BinaryFunction *> &Elmt,
342342
uint64_t Value) { return Elmt.first > Value; });
343343
if (Lower == Top10Funcs.end() && Top10Funcs.size() >= 10)

bolt/lib/Passes/SplitFunctions.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ struct SplitProfile2 {
129129
}
130130

131131
template <typename It> void partition(const It Start, const It End) const {
132-
std::for_each(Start, End, [](BinaryBasicBlock *const BB) {
132+
for (BinaryBasicBlock *const BB : llvm::make_range(Start, End)) {
133133
assert(BB->canOutline() &&
134134
"Moving a block that is not outlineable to cold fragment");
135135
BB->setFragmentNum(FragmentNum::cold());
136-
});
136+
}
137137
}
138138
};
139139

@@ -155,9 +155,8 @@ struct SplitRandom2 {
155155
std::uniform_int_distribution<DiffT> Dist(MinimumSplit,
156156
NumOutlineableBlocks);
157157
const DiffT NumColdBlocks = Dist(*Gen);
158-
std::for_each(End - NumColdBlocks, End, [](BinaryBasicBlock *BB) {
158+
for (BinaryBasicBlock *BB : llvm::make_range(End - NumColdBlocks, End))
159159
BB->setFragmentNum(FragmentNum::cold());
160-
});
161160

162161
LLVM_DEBUG(dbgs() << formatv("BOLT-DEBUG: randomly chose last {0} (out of "
163162
"{1} possible) blocks to split\n",
@@ -216,11 +215,11 @@ struct SplitAll {
216215

217216
template <typename It> void partition(It Start, It End) const {
218217
unsigned Fragment = 1;
219-
std::for_each(Start, End, [&](BinaryBasicBlock *const BB) {
218+
for (BinaryBasicBlock *const BB : llvm::make_range(Start, End)) {
220219
assert(BB->canOutline() &&
221220
"Moving a block that is not outlineable to cold fragment");
222221
BB->setFragmentNum(FragmentNum(Fragment++));
223-
});
222+
}
224223
}
225224
};
226225
} // namespace

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ static bool isMaxValAllBitSetLiteral(const EnumDecl *EnumDec) {
8787
}
8888

8989
static int countNonPowOfTwoLiteralNum(const EnumDecl *EnumDec) {
90-
return std::count_if(
91-
EnumDec->enumerator_begin(), EnumDec->enumerator_end(),
92-
[](const EnumConstantDecl *E) { return isNonPowerOf2NorNullLiteral(E); });
90+
return llvm::count_if(EnumDec->enumerators(), isNonPowerOf2NorNullLiteral);
9391
}
9492

9593
/// Check if there is one or two enumerators that are not a power of 2 and are

clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ std::string ConfusableIdentifierCheck::skeleton(StringRef Name) {
6868
}
6969

7070
StringRef Key(Prev, Curr - Prev);
71-
auto Where = std::lower_bound(std::begin(ConfusableEntries),
72-
std::end(ConfusableEntries), CodePoint,
73-
[](decltype(ConfusableEntries[0]) x,
74-
UTF32 y) { return x.codepoint < y; });
71+
auto Where = llvm::lower_bound(ConfusableEntries, CodePoint,
72+
[](decltype(ConfusableEntries[0]) x,
73+
UTF32 y) { return x.codepoint < y; });
7574
if (Where == std::end(ConfusableEntries) || CodePoint != Where->codepoint) {
7675
Skeleton.append(Prev, Curr);
7776
} else {

clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct AllHeuristicsBoundsWellConfigured {
9090
1>::Value;
9191
};
9292

93-
static_assert(AllHeuristicsBoundsWellConfigured::Value, "");
93+
static_assert(AllHeuristicsBoundsWellConfigured::Value);
9494
} // namespace
9595

9696
static constexpr llvm::StringLiteral DefaultAbbreviations = "addr=address;"

clang-tools-extra/clangd/Quality.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality,
591591
// Produces an integer that sorts in the same order as F.
592592
// That is: a < b <==> encodeFloat(a) < encodeFloat(b).
593593
static uint32_t encodeFloat(float F) {
594-
static_assert(std::numeric_limits<float>::is_iec559, "");
594+
static_assert(std::numeric_limits<float>::is_iec559);
595595
constexpr uint32_t TopBit = ~(~uint32_t{0} >> 1);
596596

597597
// Get the bits of the float. Endianness is the same as for integers.

0 commit comments

Comments
 (0)