Changeset View
Changeset View
Standalone View
Standalone View
lld/ELF/LTO.cpp
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
static lto::Config createConfig() { | static lto::Config createConfig() { | ||||
lto::Config c; | lto::Config c; | ||||
// LLD supports the new relocations and address-significance tables. | // LLD supports the new relocations and address-significance tables. | ||||
c.Options = initTargetOptionsFromCodeGenFlags(); | c.Options = initTargetOptionsFromCodeGenFlags(); | ||||
c.Options.RelaxELFRelocations = true; | c.Options.RelaxELFRelocations = true; | ||||
c.Options.EmitAddrsig = true; | c.Options.EmitAddrsig = true; | ||||
// Always emit a section per function/datum with LTO. | if (config->emachine != EM_BPF || !config->relocatable) { | ||||
c.Options.FunctionSections = true; | c.Options.FunctionSections = true; | ||||
c.Options.DataSections = true; | c.Options.DataSections = true; | ||||
} | |||||
MaskRay: Remove the abstraction: `emitFuncDataSections`.
Just test `config->emachine` and config… | |||||
// Check if basic block sections must be used. | // Check if basic block sections must be used. | ||||
// Allowed values for --lto-basic-block-sections are "all", "labels", | // Allowed values for --lto-basic-block-sections are "all", "labels", | ||||
// "<file name specifying basic block ids>", or none. This is the equivalent | // "<file name specifying basic block ids>", or none. This is the equivalent | ||||
// of -fbasic-block-sections= flag in clang. | // of -fbasic-block-sections= flag in clang. | ||||
if (!config->ltoBasicBlockSections.empty()) { | if (!config->ltoBasicBlockSections.empty()) { | ||||
if (config->ltoBasicBlockSections == "all") { | if (config->ltoBasicBlockSections == "all") { | ||||
c.Options.BBSections = BasicBlockSection::All; | c.Options.BBSections = BasicBlockSection::All; | ||||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |
Remove the abstraction: emitFuncDataSections.
Just test config->emachine and config->relocatable.