#include "SectionPriorities.h"
#include "BPSectionOrderer.h"
#include "Config.h"
#include "InputFiles.h"
#include "Symbols.h"
#include "Target.h"
#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/ErrorHandler.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include <numeric>
usingnamespacellvm;
usingnamespacellvm::MachO;
usingnamespacellvm::sys;
usingnamespacelld;
usingnamespacelld::macho;
PriorityBuilder macho::priorityBuilder;
namespace {
size_t highestAvailablePriority = …;
struct Edge { … };
struct Cluster { … };
class CallGraphSort { … };
constexpr int MAX_DENSITY_DEGRADATION = …;
}
CallGraphSort::CallGraphSort(const MapVector<SectionPair, uint64_t> &profile) { … }
static bool isNewDensityBad(Cluster &a, Cluster &b) { … }
static int getLeader(std::vector<int> &leaders, int v) { … }
static void mergeClusters(std::vector<Cluster> &cs, Cluster &into, int intoIdx,
Cluster &from, int fromIdx) { … }
DenseMap<const InputSection *, size_t> CallGraphSort::run() { … }
std::optional<size_t>
macho::PriorityBuilder::getSymbolPriority(const Defined *sym) { … }
void macho::PriorityBuilder::extractCallGraphProfile() { … }
void macho::PriorityBuilder::parseOrderFile(StringRef path) { … }
DenseMap<const InputSection *, size_t>
macho::PriorityBuilder::buildInputSectionPriorities() { … }