diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel index c76a65e6507fa82..d7d342551df4e21 100644 --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -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(