Skip to content

Commit 69cc3f0

Browse files
authored
Add mlir-query bazel rules (#116063)
I noticed there's no bazel query for `mlir-query`, unlike the other MLIR tools, so adding one.
1 parent 036cd27 commit 69cc3f0

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14262,6 +14262,64 @@ cc_binary(
1426214262
],
1426314263
)
1426414264

14265+
cc_library(
14266+
name = "MlirQueryUtils",
14267+
srcs = glob(
14268+
[
14269+
"lib/Query/Matcher/*.cpp",
14270+
"lib/Query/Matcher/*.h",
14271+
"lib/Query/*.cpp",
14272+
"lib/Query/*.h",
14273+
],
14274+
),
14275+
hdrs = glob(
14276+
[
14277+
"include/mlir/Query/Matcher/*.h",
14278+
"include/mlir/Query/*.h",
14279+
],
14280+
),
14281+
includes = ["include"],
14282+
deps = [
14283+
":IR",
14284+
":Reducer",
14285+
":Rewrite",
14286+
":FuncDialect",
14287+
"//llvm:LineEditor",
14288+
"//llvm:Support",
14289+
],
14290+
)
14291+
14292+
cc_library(
14293+
name = "MlirQueryLib",
14294+
srcs = ["lib/Tools/mlir-query/MlirQueryMain.cpp"],
14295+
hdrs = ["include/mlir/Tools/mlir-query/MlirQueryMain.h"],
14296+
includes = ["include"],
14297+
deps = [
14298+
":IR",
14299+
":MlirQueryUtils",
14300+
":Parser",
14301+
":Support",
14302+
"//llvm:LineEditor",
14303+
"//llvm:Support",
14304+
],
14305+
)
14306+
14307+
cc_binary(
14308+
name = "mlir-query",
14309+
srcs = ["tools/mlir-query/mlir-query.cpp"],
14310+
includes = ["include"],
14311+
local_defines = ["MLIR_INCLUDE_TESTS"],
14312+
stamp = 0,
14313+
deps = [
14314+
":AllPassesAndDialects",
14315+
":MlirQueryLib",
14316+
":MlirQueryUtils",
14317+
":IR",
14318+
"//llvm:Support",
14319+
"//mlir/test:TestDialect",
14320+
],
14321+
)
14322+
1426514323
cc_library(
1426614324
name = "PDLLODS",
1426714325
srcs = glob(

0 commit comments

Comments
 (0)