Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / lld / MachO / BPSectionOrderer.h
blobcefd0ceb10e5610ae29e90ba4f1a28523003ee7d
1 //===- BPSectionOrderer.h ---------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// This file uses Balanced Partitioning to order sections to improve startup
10 /// time and compressed size.
11 ///
12 //===----------------------------------------------------------------------===//
14 #ifndef LLD_MACHO_BPSECTION_ORDERER_H
15 #define LLD_MACHO_BPSECTION_ORDERER_H
17 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/ADT/StringRef.h"
20 namespace lld::macho {
22 class InputSection;
24 /// Run Balanced Partitioning to find the optimal function and data order to
25 /// improve startup time and compressed size.
26 ///
27 /// It is important that .subsections_via_symbols is used to ensure functions
28 /// and data are in their own sections and thus can be reordered.
29 llvm::DenseMap<const lld::macho::InputSection *, size_t>
30 runBalancedPartitioning(size_t &highestAvailablePriority,
31 llvm::StringRef profilePath,
32 bool forFunctionCompression, bool forDataCompression,
33 bool compressionSortStartupFunctions, bool verbose);
35 } // namespace lld::macho
37 #endif