[llvm] [bazel] Add td_library target for OptParser.td (PR #86363)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 11:55:49 PDT 2024


================
@@ -4,6 +4,7 @@
 
 load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+load("//mlir:tblgen.bzl", "td_library")
----------------
rupprecht wrote:

It's definitely weird, but that file also doesn't seem MLIR specific at all, so it's not like depending on that will pull in any MLIR dependency.

Maybe we should move it under the llvm tree instead? However, llvm/tblgen.bzl already exists, and defines `gentbl`, whereas mlir/tblgen.bzl defines `gentbl_cc_library`, `gentbl_filegroup`, etc. Weird. Untangling that and updating all users to use a single tblgen bazel config is probably a big mess. I think we can go with this for now, and just update the reference to load from `:tblgen.bzl` in llvm instead once we can migrate that.

@jpienaar may know more about the differences. I'm guessing it's in mlir/tblgen.bzl because it used to have MLIR specific logic there, but now seems totally generic.

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


More information about the llvm-commits mailing list