summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/gold/gold-plugin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index 9c6de14af65..cf575d0a460 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/tools/gold/gold-plugin.cpp
@@ -183,6 +183,8 @@ namespace options {
static std::vector<const char *> extra;
// Sample profile file path
static std::string sample_profile;
+ // New pass manager
+ static bool new_pass_manager = false;
static void process_plugin_option(const char *opt_)
{
@@ -242,6 +244,8 @@ namespace options {
DisableVerify = true;
} else if (opt.startswith("sample-profile=")) {
sample_profile= opt.substr(strlen("sample-profile="));
+ } else if (opt == "new-pass-manager") {
+ new_pass_manager = true;
} else {
// Save this option to pass to the code generator.
// ParseCommandLineOptions() expects argv[0] to be program name. Lazily
@@ -805,6 +809,9 @@ static std::unique_ptr<LTO> createLTO() {
if (!options::sample_profile.empty())
Conf.SampleProfile = options::sample_profile;
+ // Use new pass manager if set in driver
+ Conf.UseNewPM = options::new_pass_manager;
+
return llvm::make_unique<LTO>(std::move(Conf), Backend,
options::ParallelCodeGenParallelismLevel);
}
OpenPOWER on IntegriCloud