Skip to content

Commit

Permalink
Add mlir-query bazel rules (#116063)
Browse files Browse the repository at this point in the history
I noticed there's no bazel query for `mlir-query`, unlike the other MLIR
tools, so adding one.
  • Loading branch information
j2kun authored Nov 21, 2024
1 parent 036cd27 commit 69cc3f0
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14262,6 +14262,64 @@ cc_binary(
],
)

cc_library(
name = "MlirQueryUtils",
srcs = glob(
[
"lib/Query/Matcher/*.cpp",
"lib/Query/Matcher/*.h",
"lib/Query/*.cpp",
"lib/Query/*.h",
],
),
hdrs = glob(
[
"include/mlir/Query/Matcher/*.h",
"include/mlir/Query/*.h",
],
),
includes = ["include"],
deps = [
":IR",
":Reducer",
":Rewrite",
":FuncDialect",
"//llvm:LineEditor",
"//llvm:Support",
],
)

cc_library(
name = "MlirQueryLib",
srcs = ["lib/Tools/mlir-query/MlirQueryMain.cpp"],
hdrs = ["include/mlir/Tools/mlir-query/MlirQueryMain.h"],
includes = ["include"],
deps = [
":IR",
":MlirQueryUtils",
":Parser",
":Support",
"//llvm:LineEditor",
"//llvm:Support",
],
)

cc_binary(
name = "mlir-query",
srcs = ["tools/mlir-query/mlir-query.cpp"],
includes = ["include"],
local_defines = ["MLIR_INCLUDE_TESTS"],
stamp = 0,
deps = [
":AllPassesAndDialects",
":MlirQueryLib",
":MlirQueryUtils",
":IR",
"//llvm:Support",
"//mlir/test:TestDialect",
],
)

cc_library(
name = "PDLLODS",
srcs = glob(
Expand Down

0 comments on commit 69cc3f0

Please sign in to comment.