Toolchain type labels for c++ are filegroups instead of toolchain_type.

PiperOrigin-RevId: 168835640
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
index 981addd..da85efa 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
@@ -89,7 +89,7 @@
 
   /** Returns label used to select resolved cc_toolchain instances based on platform. */
   public static Label getCcToolchainType(String toolsRepository) {
-    return Label.parseAbsoluteUnchecked(toolsRepository + "//tools/cpp:toolchain_type");
+    return Label.parseAbsoluteUnchecked(toolsRepository + "//tools/cpp:toolchain_category");
   }
 
   private CppHelper() {
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
index b938e5f..b5b9c4b 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
@@ -78,6 +78,7 @@
         "/bazel_tools_workspace/tools/cpp/BUILD",
         "package(default_visibility=['//visibility:public'])",
         "cc_library(name = 'stl')",
+        "toolchain_type(name = 'toolchain_type')",
         "cc_library(name = 'malloc')",
         "cc_toolchain_suite(",
         "    name = 'toolchain',",
@@ -145,16 +146,16 @@
         "    name = 'link_dynamic_library',",
         "    srcs = ['link_dynamic_library.sh'],",
         ")",
-        "toolchain_type(name = 'toolchain_type')",
+        "filegroup(name = 'toolchain_category')",
         "toolchain(",
         "   name = 'toolchain_cc-compiler-piii',",
-        "   toolchain_type = ':toolchain_type',",
+        "   toolchain_type = ':toolchain_category',",
         "   toolchain = '//third_party/crosstool/mock:cc-compiler-piii',",
         "   target_compatible_with = [':mock_value'],",
         ")",
         "toolchain(",
         "   name = 'dummy_cc_toolchain',",
-        "   toolchain_type = ':toolchain_type',",
+        "   toolchain_type = ':toolchain_category',",
         "   toolchain = ':dummy_cc_toolchain_impl',",
         ")",
         "load(':dummy_toolchain.bzl', 'dummy_toolchain')",
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index eb75333..a693b76 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -205,7 +205,7 @@
     srcs = ["link_dynamic_library.sh"],
 )
 
-toolchain_type(name = "toolchain_type")
+filegroup(name = "toolchain_category")
 
 # A dummy toolchain is necessary to satisfy toolchain resolution until platforms
 # are used in c++ by default.
@@ -213,7 +213,7 @@
 toolchain(
     name = "dummy_cc_toolchain",
     toolchain = "dummy_cc_toolchain_impl",
-    toolchain_type = ":toolchain_type",
+    toolchain_type = ":toolchain_category",
 )
 
 load(":dummy_toolchain.bzl", "dummy_toolchain")
diff --git a/tools/cpp/BUILD.static b/tools/cpp/BUILD.static
index aaadc5b..65bbac1 100644
--- a/tools/cpp/BUILD.static
+++ b/tools/cpp/BUILD.static
@@ -116,7 +116,7 @@
     srcs = ["link_dynamic_library.sh"],
 )
 
-toolchain_type(name = "toolchain_type")
+filegroup(name = "toolchain_category")
 
 # A dummy toolchain is necessary to satisfy toolchain resolution until platforms
 # are used in c++ by default.
@@ -124,7 +124,7 @@
 toolchain(
     name = "dummy_cc_toolchain",
     toolchain = "dummy_cc_toolchain_impl",
-    toolchain_type = ":toolchain_type",
+    toolchain_type = ":toolchain_category",
 )
 
 load(":dummy_toolchain.bzl", "dummy_toolchain")
diff --git a/tools/cpp/BUILD.tpl b/tools/cpp/BUILD.tpl
index 170fe3f..32b796d 100644
--- a/tools/cpp/BUILD.tpl
+++ b/tools/cpp/BUILD.tpl
@@ -76,7 +76,7 @@
     supports_param_files = 1,
 )
 
-toolchain_type(name = "toolchain_type")
+filegroup(name = "toolchain_category")
 
 # A dummy toolchain is necessary to satisfy toolchain resolution until platforms
 # are used in c++ by default.
@@ -84,7 +84,7 @@
 toolchain(
     name = "dummy_cc_toolchain",
     toolchain = "dummy_cc_toolchain_impl",
-    toolchain_type = ":toolchain_type",
+    toolchain_type = ":toolchain_category",
 )
 
 load(":dummy_toolchain.bzl", "dummy_toolchain")