Changeset View
Changeset View
Standalone View
Standalone View
llvm/tools/gold/gold-plugin.cpp
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | #endif | ||||
// New pass manager | // New pass manager | ||||
static bool new_pass_manager = false; | static bool new_pass_manager = false; | ||||
// Debug new pass manager | // Debug new pass manager | ||||
static bool debug_pass_manager = false; | static bool debug_pass_manager = false; | ||||
// Directory to store the .dwo files. | // Directory to store the .dwo files. | ||||
static std::string dwo_dir; | static std::string dwo_dir; | ||||
/// Statistics output filename. | /// Statistics output filename. | ||||
static std::string stats_file; | static std::string stats_file; | ||||
// Asserts that LTO link has whole program visibility | |||||
static bool whole_program_visibility = false; | |||||
// Optimization remarks filename, accepted passes and hotness options | // Optimization remarks filename, accepted passes and hotness options | ||||
static std::string RemarksFilename; | static std::string RemarksFilename; | ||||
static std::string RemarksPasses; | static std::string RemarksPasses; | ||||
static bool RemarksWithHotness = false; | static bool RemarksWithHotness = false; | ||||
static std::string RemarksFormat; | static std::string RemarksFormat; | ||||
// Context sensitive PGO options. | // Context sensitive PGO options. | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | static void process_plugin_option(const char *opt_) | ||||
} else if (opt == "cs-profile-generate") { | } else if (opt == "cs-profile-generate") { | ||||
cs_pgo_gen = true; | cs_pgo_gen = true; | ||||
} else if (opt.startswith("cs-profile-path=")) { | } else if (opt.startswith("cs-profile-path=")) { | ||||
cs_profile_path = opt.substr(strlen("cs-profile-path=")); | cs_profile_path = opt.substr(strlen("cs-profile-path=")); | ||||
} else if (opt == "new-pass-manager") { | } else if (opt == "new-pass-manager") { | ||||
new_pass_manager = true; | new_pass_manager = true; | ||||
} else if (opt == "debug-pass-manager") { | } else if (opt == "debug-pass-manager") { | ||||
debug_pass_manager = true; | debug_pass_manager = true; | ||||
} else if (opt == "whole-program-visibility") { | |||||
whole_program_visibility = true; | |||||
} else if (opt.startswith("dwo_dir=")) { | } else if (opt.startswith("dwo_dir=")) { | ||||
dwo_dir = opt.substr(strlen("dwo_dir=")); | dwo_dir = opt.substr(strlen("dwo_dir=")); | ||||
} else if (opt.startswith("opt-remarks-filename=")) { | } else if (opt.startswith("opt-remarks-filename=")) { | ||||
RemarksFilename = opt.substr(strlen("opt-remarks-filename=")); | RemarksFilename = opt.substr(strlen("opt-remarks-filename=")); | ||||
} else if (opt.startswith("opt-remarks-passes=")) { | } else if (opt.startswith("opt-remarks-passes=")) { | ||||
RemarksPasses = opt.substr(strlen("opt-remarks-passes=")); | RemarksPasses = opt.substr(strlen("opt-remarks-passes=")); | ||||
} else if (opt == "opt-remarks-with-hotness") { | } else if (opt == "opt-remarks-with-hotness") { | ||||
RemarksWithHotness = true; | RemarksWithHotness = true; | ||||
▲ Show 20 Lines • Show All 627 Lines • ▼ Show 20 Lines | static std::unique_ptr<LTO> createLTO(IndexWriteCallback OnIndexWrite, | ||||
Conf.RemarksWithHotness = options::RemarksWithHotness; | Conf.RemarksWithHotness = options::RemarksWithHotness; | ||||
Conf.RemarksFormat = options::RemarksFormat; | Conf.RemarksFormat = options::RemarksFormat; | ||||
// Use new pass manager if set in driver | // Use new pass manager if set in driver | ||||
Conf.UseNewPM = options::new_pass_manager; | Conf.UseNewPM = options::new_pass_manager; | ||||
// Debug new pass manager if requested | // Debug new pass manager if requested | ||||
Conf.DebugPassManager = options::debug_pass_manager; | Conf.DebugPassManager = options::debug_pass_manager; | ||||
Conf.HasWholeProgramVisibility = options::whole_program_visibility; | |||||
Conf.StatsFile = options::stats_file; | Conf.StatsFile = options::stats_file; | ||||
return std::make_unique<LTO>(std::move(Conf), Backend, | return std::make_unique<LTO>(std::move(Conf), Backend, | ||||
options::ParallelCodeGenParallelismLevel); | options::ParallelCodeGenParallelismLevel); | ||||
} | } | ||||
// Write empty files that may be expected by a distributed build | // Write empty files that may be expected by a distributed build | ||||
// system when invoked with thinlto_index_only. This is invoked when | // system when invoked with thinlto_index_only. This is invoked when | ||||
// the linker has decided not to include the given module in the | // the linker has decided not to include the given module in the | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |