Skip to content

Commit 8d2b070

Browse files
committed
[ELF] Internalize computeCacheDirectedSortOrder. NFC
and delete an incorremtn comment about ctx.arg.callGraphProfile
1 parent c2f7745 commit 8d2b070

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

lld/ELF/CallGraphSort.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ DenseMap<const InputSectionBase *, int> CallGraphSort::run() {
276276
// Sort sections by the profile data using the Cache-Directed Sort algorithm.
277277
// The placement is done by optimizing the locality by co-locating frequently
278278
// executed code sections together.
279-
DenseMap<const InputSectionBase *, int>
280-
elf::computeCacheDirectedSortOrder(Ctx &ctx) {
279+
static DenseMap<const InputSectionBase *, int>
280+
computeCacheDirectedSortOrder(Ctx &ctx) {
281281
SmallVector<uint64_t, 0> funcSizes;
282282
SmallVector<uint64_t, 0> funcCounts;
283283
SmallVector<codelayout::EdgeCount, 0> callCounts;

lld/ELF/CallGraphSort.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ namespace lld::elf {
1515
struct Ctx;
1616
class InputSectionBase;
1717

18-
llvm::DenseMap<const InputSectionBase *, int>
19-
computeCacheDirectedSortOrder(Ctx &);
20-
2118
llvm::DenseMap<const InputSectionBase *, int>
2219
computeCallGraphProfileOrder(Ctx &);
2320
} // namespace lld::elf

lld/ELF/Writer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ static void maybeShuffle(Ctx &ctx,
10831083
// Builds section order for handling --symbol-ordering-file.
10841084
static DenseMap<const InputSectionBase *, int> buildSectionOrder(Ctx &ctx) {
10851085
DenseMap<const InputSectionBase *, int> sectionOrder;
1086-
// Use the rarely used option --call-graph-ordering-file to sort sections.
10871086
if (!ctx.arg.callGraphProfile.empty())
10881087
return computeCallGraphProfileOrder(ctx);
10891088

0 commit comments

Comments
 (0)