Path: blob/main/contrib/llvm-project/lld/ELF/BPSectionOrderer.h
213726 views
//===- BPSectionOrderer.h -------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// This file uses Balanced Partitioning to order sections to improve startup9/// time and compressed size.10///11//===----------------------------------------------------------------------===//1213#ifndef LLD_ELF_BPSECTION_ORDERER_H14#define LLD_ELF_BPSECTION_ORDERER_H1516#include "llvm/ADT/DenseMap.h"17#include "llvm/ADT/StringRef.h"1819namespace lld::elf {20struct Ctx;21class InputSectionBase;2223/// Run Balanced Partitioning to find the optimal function and data order to24/// improve startup time and compressed size.25///26/// It is important that -ffunction-sections and -fdata-sections compiler flags27/// are used to ensure functions and data are in their own sections and thus28/// can be reordered.29llvm::DenseMap<const InputSectionBase *, int>30runBalancedPartitioning(Ctx &ctx, llvm::StringRef profilePath,31bool forFunctionCompression, bool forDataCompression,32bool compressionSortStartupFunctions, bool verbose);3334} // namespace lld::elf3536#endif373839