brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · a27f605 Raw
36 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8///9/// This file uses Balanced Partitioning to order sections to improve startup10/// time and compressed size.11///12//===----------------------------------------------------------------------===//13 14#ifndef LLD_MACHO_BPSECTION_ORDERER_H15#define LLD_MACHO_BPSECTION_ORDERER_H16 17#include "llvm/ADT/DenseMap.h"18#include "llvm/ADT/StringRef.h"19 20namespace lld::macho {21class InputSection;22 23/// Run Balanced Partitioning to find the optimal function and data order to24/// improve startup time and compressed size.25///26/// It is important that .subsections_via_symbols is used to ensure functions27/// and data are in their own sections and thus can be reordered.28llvm::DenseMap<const InputSection *, int>29runBalancedPartitioning(llvm::StringRef profilePath,30                        bool forFunctionCompression, bool forDataCompression,31                        bool compressionSortStartupFunctions, bool verbose);32 33} // namespace lld::macho34 35#endif36