1//===- BPSectionOrderer.h -------------------------------------------------===//
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//===----------------------------------------------------------------------===//
13
14#ifndef LLD_ELF_BPSECTION_ORDERER_H
15#define LLD_ELF_BPSECTION_ORDERER_H
16
17#include "llvm/ADT/DenseMap.h"
18#include "llvm/ADT/StringRef.h"
19
20namespace lld::elf {
21struct Ctx;
22class InputSectionBase;
23
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 -ffunction-sections and -fdata-sections compiler flags
28/// are used to ensure functions and data are in their own sections and thus
29/// can be reordered.
30llvm::DenseMap<const InputSectionBase *, int>
31runBalancedPartitioning(Ctx &ctx, llvm::StringRef profilePath,
32 bool forFunctionCompression, bool forDataCompression,
33 bool compressionSortStartupFunctions, bool verbose);
34
35} // namespace lld::elf
36
37#endif
38

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of lld/ELF/BPSectionOrderer.h