[llvm] [bazel] expose MLIR Pygments lexer to bazel overlay (PR #158604)

Perry Gibson via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 04:16:38 PDT 2025


https://github.com/Wheest created https://github.com/llvm/llvm-project/pull/158604

[This existing tool](https://github.com/llvm/llvm-project/tree/main/mlir/utils/pygments) allows us to do code highlighting for MLIR, e.g., for use in docs.

However, it is not currently exposed to Bazel.  Here, I do this using `exports_files`, and rely on the user to create a `py_library`.



>From 31a8b090be04adebb7fd021eefdeab3dda528109 Mon Sep 17 00:00:00 2001
From: Perry Gibson <perry at fractile.ai>
Date: Mon, 15 Sep 2025 13:11:45 +0200
Subject: [PATCH] feat: expose mlir_lexer.py to bazel overlay

---
 utils/bazel/llvm-project-overlay/mlir/BUILD.bazel | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 826fb03273e6d..cae7acdb7ce13 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -27,6 +27,7 @@ exports_files([
     "LICENSE.TXT",
     "run_lit.sh",
     "utils/lldb-scripts/mlirDataFormatters.py",
+    "utils/pygments/mlir_lexer.py",
     "utils/textmate/mlir.json",
 ])
 



More information about the llvm-commits mailing list