[llvm] [bazel] Update tblgen rules to support path-mapping (PR #158354)

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 09:13:33 PDT 2025


================
@@ -234,15 +222,16 @@ def _gentbl_test_impl(ctx):
     # workspace is not the main workspace. Therefore it is not included in the
     # _resolve_includes call that prepends this prefix.
     trans_includes = _get_transitive_includes(
-        _resolve_includes(ctx, ctx.attr.includes + ["/"]) +
-        _prefix_roots(ctx, [td_file.dirname]),
+        _resolve_includes(ctx, ctx.attr.includes + ["/"]) + [td_file.dirname],
         ctx.attr.deps,
     )
 
     test_args = [ctx.executable.tblgen.short_path]
     test_args.extend(ctx.attr.opts)
     test_args.append(td_file.path)
-    test_args.extend(["-I " + include for include in trans_includes.to_list()])
+    for include in trans_includes.to_list():
+        test_args.extend(["-I", include])
+        test_args.extend(["-I", paths.join(ctx.bin_dir.path, include)])
----------------
keith wrote:

updated

https://github.com/llvm/llvm-project/pull/158354


More information about the llvm-commits mailing list