Cleanup references to concurrent_links in gn binary.

Explicit pool are recommended and concurrent_links is deprecated.
Remove concurrent_links support as it should no longer be used.

BUG=612786

Review-Url: https://codereview.chromium.org/2211593002
Cr-Original-Commit-Position: refs/heads/master@{#409909}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 662a802270f017a00bc870f12866b8f581596d79
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index d25782f..f06b517 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -2022,6 +2022,7 @@
       The output file directory corresponding to the path of the
       given file, not including a trailing slash.
         "//foo/bar/baz.txt" => "//out/Default/obj/foo/bar"
+
   "gen_dir"
       The generated file directory corresponding to the path of the
       given file, not including a trailing slash.
@@ -3437,20 +3438,6 @@
     requires a lot of duplicate of rules) so should only be used when
     absolutely necessary.
 
-  concurrent_links
-    In integer expressing the number of links that Ninja will perform in
-    parallel. GN will create a pool for shared library and executable
-    link steps with this many processes. Since linking is memory- and
-    I/O-intensive, projects with many large targets may want to limit
-    the number of parallel steps to avoid overloading the computer.
-    Since creating static libraries is generally not as intensive
-    there is no limit to "alink" steps.
-
-    Defaults to 0 which Ninja interprets as "no limit".
-
-    The value used will be the one from the default toolchain of the
-    current build.
-
 ```
 
 ### **Invoking targets in toolchains**:
@@ -3481,8 +3468,6 @@
 ### **Example**:
 ```
   toolchain("plugin_toolchain") {
-    concurrent_links = 8
-
     tool("cc") {
       command = "gcc {{source}}"
       ...
diff --git a/tools/gn/function_toolchain.cc b/tools/gn/function_toolchain.cc
index 3501ec1..faa190e 100644
--- a/tools/gn/function_toolchain.cc
+++ b/tools/gn/function_toolchain.cc
@@ -332,20 +332,6 @@
     "    requires a lot of duplicate of rules) so should only be used when\n"
     "    absolutely necessary.\n"
     "\n"
-    "  concurrent_links\n"
-    "    In integer expressing the number of links that Ninja will perform in\n"
-    "    parallel. GN will create a pool for shared library and executable\n"
-    "    link steps with this many processes. Since linking is memory- and\n"
-    "    I/O-intensive, projects with many large targets may want to limit\n"
-    "    the number of parallel steps to avoid overloading the computer.\n"
-    "    Since creating static libraries is generally not as intensive\n"
-    "    there is no limit to \"alink\" steps.\n"
-    "\n"
-    "    Defaults to 0 which Ninja interprets as \"no limit\".\n"
-    "\n"
-    "    The value used will be the one from the default toolchain of the\n"
-    "    current build.\n"
-    "\n"
     "Invoking targets in toolchains:\n"
     "\n"
     "  By default, when a target depends on another, there is an implicit\n"
@@ -370,8 +356,6 @@
     "\n"
     "Example:\n"
     "  toolchain(\"plugin_toolchain\") {\n"
-    "    concurrent_links = 8\n"
-    "\n"
     "    tool(\"cc\") {\n"
     "      command = \"gcc {{source}}\"\n"
     "      ...\n"
@@ -428,21 +412,6 @@
       return Value();
   }
 
-  // Read concurrent_links (if any).
-  const Value* concurrent_links_value =
-      block_scope.GetValue("concurrent_links", true);
-  if (concurrent_links_value) {
-    if (!concurrent_links_value->VerifyTypeIs(Value::INTEGER, err))
-      return Value();
-    if (concurrent_links_value->int_value() < 0 ||
-        concurrent_links_value->int_value() > std::numeric_limits<int>::max()) {
-      *err = Err(*concurrent_links_value, "Value out of range.");
-      return Value();
-    }
-    toolchain->set_concurrent_links(
-        static_cast<int>(concurrent_links_value->int_value()));
-  }
-
   if (!block_scope.CheckForUnusedVars(err))
     return Value();
 
diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc
index a7f56f9..fba1ccb 100644
--- a/tools/gn/ninja_build_writer.cc
+++ b/tools/gn/ninja_build_writer.cc
@@ -254,10 +254,6 @@
 }
 
 void NinjaBuildWriter::WriteAllPools() {
-  out_ << "pool link_pool\n"
-       << "  depth = " << default_toolchain_->concurrent_links() << std::endl
-       << std::endl;
-
   // Compute the pools referenced by all tools of all used toolchains.
   std::set<const Pool*> used_pools;
   for (const auto& pair : used_toolchains_) {
diff --git a/tools/gn/ninja_build_writer_unittest.cc b/tools/gn/ninja_build_writer_unittest.cc
index abb5475..9fee37a 100644
--- a/tools/gn/ninja_build_writer_unittest.cc
+++ b/tools/gn/ninja_build_writer_unittest.cc
@@ -66,9 +66,6 @@
       "build build.ninja: gn\n"
       "  generator = 1\n"
       "  depfile = build.ninja.d\n";
-  const char expected_link_pool[] =
-      "pool link_pool\n"
-      "  depth = 0\n";
   const char expected_other_pool[] =
       "pool other_toolchain_other_pool\n"
       "  depth = 42\n";
@@ -91,7 +88,6 @@
         "Within: " << out_str
   EXPECT_SNIPPET(expected_rule_gn);
   EXPECT_SNIPPET(expected_build_ninja);
-  EXPECT_SNIPPET(expected_link_pool);
   EXPECT_SNIPPET(expected_other_pool);
   EXPECT_SNIPPET(expected_toolchain);
   EXPECT_SNIPPET(expected_targets);
diff --git a/tools/gn/toolchain.cc b/tools/gn/toolchain.cc
index 03c9c59..70c6ce0 100644
--- a/tools/gn/toolchain.cc
+++ b/tools/gn/toolchain.cc
@@ -29,7 +29,6 @@
 
 Toolchain::Toolchain(const Settings* settings, const Label& label)
     : Item(settings, label),
-      concurrent_links_(0),
       setup_complete_(false) {
 }
 
diff --git a/tools/gn/toolchain.h b/tools/gn/toolchain.h
index 4ccfdc8..7b61f34 100644
--- a/tools/gn/toolchain.h
+++ b/tools/gn/toolchain.h
@@ -124,16 +124,9 @@
     return substitution_bits_;
   }
 
-  void set_concurrent_links(int cl) { concurrent_links_ = cl; }
-  int concurrent_links() const { return concurrent_links_; }
-
  private:
   std::unique_ptr<Tool> tools_[TYPE_NUMTYPES];
 
-  // How many links to run in parallel. Only the default toolchain's version of
-  // this variable applies.
-  int concurrent_links_;
-
   bool setup_complete_;
 
   // Substitutions used by the tools in this toolchain.