Repository: kythe/kythe (language: rust)

Issue:
Update switch statements for the new clang::TemplateArgument::StructuralValue value
https://github.com/llvm/llvm-project/commit/5518a9d7673bfe55b4110bea049140316d032fbf

adds StructuralValue` enum value that breaks kythe build in a few places where switch over an argument is used under kythe/cxx/indexer/cxx/*

Steps to reproduce: build with clang past 5518a9d7673bfe55b4110bea049140316d032fbf.


Discussion / hints:

Fix patch:
diff --git a/kythe/cxx/indexer/cxx/IndexerASTHooks.cc b/kythe/cxx/indexer/cxx/IndexerASTHooks.cc
index ea90d6b110..cbb2811ce5 100644
--- a/kythe/cxx/indexer/cxx/IndexerASTHooks.cc
+++ b/kythe/cxx/indexer/cxx/IndexerASTHooks.cc
@@ -4219,6 +4219,11 @@ GraphObserver::NodeId IndexerASTVisitor::BuildNodeIdForSpecialTemplateArgument(
   return Observer.MakeNodeId(Observer.getDefaultClaimToken(), Ostream.str());
 }
 
+std::optional<GraphObserver::NodeId>
+IndexerASTVisitor::BuildNodeIdForStructuralValue(const clang::APValue& value) {
+  return std::nullopt;
+}
+
 std::optional<GraphObserver::NodeId>
 IndexerASTVisitor::BuildNodeIdForTemplateExpansion(clang::TemplateName Name) {
   return BuildNodeIdForTemplateName(Name);
@@ -4271,6 +4276,8 @@ IndexerASTVisitor::BuildNodeIdForTemplateArgument(
     case TemplateArgument::Integral:
       return BuildNodeIdForSpecialTemplateArgument(
           llvm::toString(Arg.getAsIntegral(), 10) + "i");
+    case TemplateArgument::StructuralValue:
+      return BuildNodeIdForStructuralValue(Arg.getAsStructuralValue());
     case TemplateArgument::Template:
       return BuildNodeIdForTemplateName(Arg.getAsTemplate());
     case TemplateArgument::TemplateExpansion:
diff --git a/kythe/cxx/indexer/cxx/IndexerASTHooks.h b/kythe/cxx/indexer/cxx/IndexerASTHooks.h
index c2455fcf65..b4bcf7af0e 100644
--- a/kythe/cxx/indexer/cxx/IndexerASTHooks.h
+++ b/kythe/cxx/indexer/cxx/IndexerASTHooks.h
@@ -311,6 +311,10 @@ class IndexerASTVisitor : public RecursiveTypeVisitor<IndexerASTVisitor> {
   GraphObserver::NodeId BuildNodeIdForSpecialTemplateArgument(
       llvm::StringRef Id);
 
+  /// \brief Builds a stable node ID for a structural value (stub).
+  std::optional<GraphObserver::NodeId> BuildNodeIdForStructuralValue(
+      const clang::APValue& value);
+
   /// \brief Builds a stable node ID for a template expansion template argument.
   /// \param Name The template pattern being expanded.
   std::optional<GraphObserver::NodeId> BuildNodeIdForTemplateExpansion(
diff --git a/kythe/cxx/indexer/cxx/marked_source.cc b/kythe/cxx/indexer/cxx/marked_source.cc
index dbf7f177fd..8aa9cac058 100644
--- a/kythe/cxx/indexer/cxx/marked_source.cc
+++ b/kythe/cxx/indexer/cxx/marked_source.cc
@@ -609,6 +609,7 @@ void MarkedSourceGenerator::ReplaceMarkedSourceWithTemplateArgumentList(
         case clang::TemplateArgument::Declaration:
         case clang::TemplateArgument::NullPtr:
         case clang::TemplateArgument::Integral:
+        case clang::TemplateArgument::StructuralValue:
         case clang::TemplateArgument::Template:
         case clang::TemplateArgument::TemplateExpansion:
         case clang::TemplateArgument::Expression:
diff --git a/kythe/cxx/indexer/cxx/semantic_hash.cc b/kythe/cxx/indexer/cxx/semantic_hash.cc
index 6ea4879179..5e1e080111 100644
--- a/kythe/cxx/indexer/cxx/semantic_hash.cc
+++ b/kythe/cxx/indexer/cxx/semantic_hash.cc
@@ -81,6 +81,9 @@ uint64_t SemanticHash::Hash(const clang::TemplateArgument& arg) const {
         return std::hash<std::string>()(llvm::toString(value, 10));
       }
     }
+    case TemplateArgument::StructuralValue:
+      CHECK(ignore_unimplemented_) << "SemanticHash(StructuralValue)";
+      return 0;
     case TemplateArgument::Template:
       return Hash(arg.getAsTemplate()) ^ 0x4040404004040404LL;
     case TemplateArgument::TemplateExpansion:
diff --git a/setup.bzl b/setup.bzl
index bb3526dda8..09c1acbf7f 100644
--- a/setup.bzl
+++ b/setup.bzl
@@ -174,7 +174,7 @@ def kythe_rule_repositories():
     maybe(
         github_archive,
         repo_name = "llvm/llvm-project",
-        commit = "5c1f44193dd6a7d3453fc002130f5cbc7cb351c2",
+        commit = "21830c913505b1fd2cf10e454253483180c7e10b",
         name = "llvm-raw",
         build_file_content = "#empty",
         patch_args = ["-p1"],
diff --git a/third_party/llvm-bazel-glob.patch b/third_party/llvm-bazel-glob.patch
index b4a4525b4f..c9e2391001 100644
--- a/third_party/llvm-bazel-glob.patch
+++ b/third_party/llvm-bazel-glob.patch
@@ -1,42 +1,407 @@
+diff --git a/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel b/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel
+index 172620adc58c..fb6f0bfe7486 100644
+--- a/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/bolt/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+ 
+ package(
+diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel
+index 317863de3b36..4a826543157c 100644
+--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clang-tidy/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
+ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+ load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
+diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel
+index 28f90efb3ba7..c1af725fd26d 100644
+--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/include-cleaner/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
+ 
+ package(
+diff --git a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
+index 12e87cec4b76..f2f525592410 100644
+--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/unittests/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@rules_cc//cc:defs.bzl", "cc_test")
+ 
+ package(
 diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
-index 6a61b99f9..5cce43bb1 100644
+index a0c547b55844..1a4bfc15c6ee 100644
 --- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
 +++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
 @@ -2,6 +2,7 @@
  # See https://llvm.org/LICENSE.txt for license information.
  # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
+ 
 +load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
  load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
  load("//:workspace_root.bzl", "workspace_root")
  load("//llvm:tblgen.bzl", "gentbl")
-@@ -18,7 +19,7 @@
-
+diff --git a/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
+index 095efe9babfb..11e833636827 100644
+--- a/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
+@@ -2,6 +2,8 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
++
  package(
      default_visibility = ["//visibility:public"],
--    features = ["layering_check"],
-+    features = ["-layering_check"],
  )
-
- licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+index bba18bfd387a..a3d4d0da713f 100644
+--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+@@ -2,6 +2,8 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
++
+ package(
+     default_visibility = ["//visibility:public"],
+     features = ["layering_check"],
+diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+index 6fa47c0090b8..e8e4122eff4f 100644
+--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+@@ -2,6 +2,8 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
++
+ # LLVM libc project.
+ load("@bazel_skylib//lib:selects.bzl", "selects")
+ load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
+diff --git a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel
+index a01aa13ed4f9..ee78eb17dd62 100644
+--- a/utils/bazel/llvm-project-overlay/lld/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/lld/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+ load("//llvm:tblgen.bzl", "gentbl")
+ load("//llvm:binary_alias.bzl", "binary_alias")
 diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
-index 93e905260..2c3cedcd9 100644
+index b22ec01376be..ec1b6d6f1549 100644
 --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
 +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
 @@ -2,6 +2,7 @@
  # See https://llvm.org/LICENSE.txt for license information.
  # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
+ 
 +load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
  load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
  load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
- load(":tblgen.bzl", "gentbl")
-@@ -12,7 +13,7 @@
-
+ load(":binary_alias.bzl", "binary_alias")
+diff --git a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
+index 99b924626c2a..68c2da661b98 100644
+--- a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:tblgen.bzl", "gentbl")
+ 
  package(
-     default_visibility = ["//visibility:public"],
--    features = ["layering_check"],
-+    features = ["-layering_check"],
- )
-
+diff --git a/utils/bazel/llvm-project-overlay/llvm/utils/lit/tests/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/utils/lit/tests/BUILD.bazel
+index b9e0a2e153ac..6a6989d6e45c 100644
+--- a/utils/bazel/llvm-project-overlay/llvm/utils/lit/tests/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/llvm/utils/lit/tests/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+ load("//llvm:lit_test.bzl", "lit_test", "package_path")
+ 
+diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+index c0c16957c5c8..e32ba19dabc3 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+@@ -5,6 +5,7 @@
+ # Description:
+ #   The MLIR "Multi-Level Intermediate Representation" Compiler Infrastructure
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+ load("@bazel_skylib//rules:write_file.bzl", "write_file")
+ load(
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel
+index 2d4e1b5d6986..fdd6a3a9d710 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch1/BUILD.bazel
+@@ -1,3 +1,5 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
++
+ # Description:
+ #   MLIR Tutorial
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel
+index 6fdd2fbea865..a89bc3c899ab 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch2/BUILD.bazel
+@@ -1,6 +1,7 @@
+ # Description:
+ #   MLIR Tutorial
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel
+index 44e27797e6cc..3ce6dba163f3 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch3/BUILD.bazel
+@@ -1,6 +1,7 @@
+ # Description:
+ #   MLIR Tutorial
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
+index 665c6fdf2cf8..d97da22bd2d4 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
+@@ -1,6 +1,7 @@
+ # Description:
+ #   MLIR Tutorial
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
+index a94eb5dc0536..f17248b68758 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
+@@ -1,6 +1,7 @@
+ # Description:
+ #   MLIR Tutorial
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
+index 7543db7c2c27..17db5f5cdb07 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
+@@ -1,6 +1,7 @@
+ # Description:
+ #   MLIR Tutorial
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
+index 297fb4e17e8e..f458ab1a74da 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
+@@ -1,6 +1,7 @@
+ # Description:
+ #   MLIR Tutorial
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel
+index f19c2336e6bc..d55feab71c4a 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel
+@@ -8,6 +8,7 @@
+ # We define separate filegroups for files in different directories so
+ # that downstream users can mirror the tree in their own py_library() rules.
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_filegroup", "td_library")
+ 
+ package(default_visibility = ["//visibility:public"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Analysis/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Analysis/BUILD.bazel
+index 83a17efbbd66..c53d8ef3247b 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Analysis/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Analysis/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
+index 43f88939a515..ee454047f95a 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+ load("//llvm:lit_test.bzl", "package_path")
+ load("//mlir:build_defs.bzl", "if_cuda_available")
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Conversion/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Conversion/BUILD.bazel
+index b00e8f243c29..da3963f55c56 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Conversion/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Conversion/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Dialect/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Dialect/BUILD.bazel
+index 1fd6885db8bc..ba3424a91342 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Dialect/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Dialect/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/IR/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/IR/BUILD.bazel
+index 83a17efbbd66..c53d8ef3247b 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/IR/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/IR/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Pass/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Pass/BUILD.bazel
+index 83a17efbbd66..c53d8ef3247b 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Pass/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Pass/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Rewrite/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Rewrite/BUILD.bazel
+index 83a17efbbd66..c53d8ef3247b 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Rewrite/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Rewrite/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Target/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Target/BUILD.bazel
+index 5dd22ea50e8d..25d6187ac691 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Target/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Target/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/Transforms/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/Transforms/BUILD.bazel
+index 83a17efbbd66..c53d8ef3247b 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/Transforms/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/Transforms/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/mlir-linalg-ods-gen/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/mlir-linalg-ods-gen/BUILD.bazel
+index 70d6bbcda7cd..734c80b79c06 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/mlir-linalg-ods-gen/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/mlir-linalg-ods-gen/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/mlir-lsp-server/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/mlir-lsp-server/BUILD.bazel
+index 409e44ebab6a..f8c9c9268bd0 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/mlir-lsp-server/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/mlir-lsp-server/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/mlir-opt/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/mlir-opt/BUILD.bazel
+index 83a17efbbd66..c53d8ef3247b 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/mlir-opt/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/mlir-opt/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/mlir-pdll/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/mlir-pdll/BUILD.bazel
+index 6d0580d803f6..5cf8423d9451 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/mlir-pdll/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/mlir-pdll/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel
+index 07d2e29fc24c..1adfdeab9e06 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/test/mlir-tblgen/BUILD.bazel
+@@ -1,3 +1,4 @@
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//llvm:lit_test.bzl", "lit_test")
+ 
+ licenses(["notice"])
+diff --git a/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel
+index 638b3fcf7c53..40675d8c72d8 100644
+--- a/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel
+@@ -2,6 +2,7 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
+ load("//mlir:tblgen.bzl", "gentbl_cc_library")
+ 
+ package(
+diff --git a/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel b/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel
+index 86d502ad326c..7c7aaed6bb9a 100644
+--- a/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel
++++ b/utils/bazel/llvm-project-overlay/third-party/unittest/BUILD.bazel
+@@ -2,6 +2,8 @@
+ # See https://llvm.org/LICENSE.txt for license information.
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ 
++load("@io_kythe//tools:build_rules/support.bzl", glob = "allow_empty_glob")
++
+ package(default_visibility = ["//visibility:public"])
+ 
  licenses(["notice"])


Test patch: