Skip to content

Commit 3833513

Browse files
committed
[Bazel] Adjust according to c76e280
1 parent 926c201 commit 3833513

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

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

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8217,6 +8217,53 @@ cc_library(
82178217
],
82188218
)
82198219

8220+
cc_library(
8221+
name = "IRDLToCpp",
8222+
srcs = [
8223+
"lib/Target/IRDLToCpp/IRDLToCpp.cpp",
8224+
"lib/Target/IRDLToCpp/TemplatingUtils.h",
8225+
],
8226+
hdrs = [
8227+
"include/mlir/Target/IRDLToCpp/IRDLToCpp.h",
8228+
],
8229+
includes = ["include"],
8230+
textual_hdrs = glob(["lib/Target/IRDLToCpp/Templates/*.txt"]),
8231+
deps = [
8232+
":IRDLDialect",
8233+
":Support",
8234+
"//llvm:Support",
8235+
],
8236+
)
8237+
8238+
cc_binary(
8239+
name = "irdl-to-cpp",
8240+
srcs = [
8241+
"tools/mlir-irdl-to-cpp/mlir-irdl-to-cpp.cpp",
8242+
],
8243+
deps = [
8244+
":IR",
8245+
":IRDLDialect",
8246+
":IRDLToCpp",
8247+
":ParseUtilities",
8248+
":Support",
8249+
"//llvm:Support",
8250+
],
8251+
)
8252+
8253+
cc_library(
8254+
name = "IRDLToCppTranslationRegistration",
8255+
srcs = ["lib/Target/IRDLToCpp/TranslationRegistration.cpp"],
8256+
hdrs = ["include/mlir/Target/IRDLToCpp/TranslationRegistration.h"],
8257+
includes = ["include"],
8258+
deps = [
8259+
":IR",
8260+
":IRDLDialect",
8261+
":IRDLToCpp",
8262+
":TranslateLib",
8263+
"//llvm:Support",
8264+
],
8265+
)
8266+
82208267
cc_library(
82218268
name = "ToLLVMIRTranslation",
82228269
srcs = [
@@ -8667,6 +8714,7 @@ cc_library(
86678714
hdrs = ["include/mlir/InitAllTranslations.h"],
86688715
deps = [
86698716
":FromLLVMIRTranslationRegistration",
8717+
":IRDLToCppTranslationRegistration",
86708718
":SPIRVTranslateRegistration",
86718719
":TargetCpp",
86728720
":TargetSMTLIB",
@@ -8898,6 +8946,7 @@ cc_binary(
88988946
"//mlir/test:TestFuncToLLVM",
88998947
"//mlir/test:TestGPU",
89008948
"//mlir/test:TestIR",
8949+
"//mlir/test:TestIRDLToCpp",
89018950
"//mlir/test:TestLLVM",
89028951
"//mlir/test:TestLinalg",
89038952
"//mlir/test:TestLoopLikeInterface",

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,34 @@ cc_library(
256256
],
257257
)
258258

259+
genrule(
260+
name = "test_irdl_to_cpp_gen",
261+
srcs = ["lib/Dialect/TestIRDLToCpp/test_irdl_to_cpp.irdl.mlir"],
262+
outs = ["lib/Dialect/TestIRDLToCpp/test_irdl_to_cpp.irdl.mlir.cpp.inc"],
263+
cmd = "$(location //mlir:irdl-to-cpp) lib/Dialect/TestIRDLToCpp/test_irdl_to_cpp.irdl.mlir -o $@",
264+
tools = ["//mlir:irdl-to-cpp"],
265+
)
266+
267+
cc_library(
268+
name = "TestIRDLToCpp",
269+
srcs = glob(["lib/Dialect/TestIRDLToCpp/*.cpp"]) + ["lib/Dialect/TestIRDLToCpp/test_irdl_to_cpp.irdl.mlir.cpp.inc"],
270+
hdrs = glob(["lib/Dialect/TestIRDLToCpp/*.h"]),
271+
includes = ["lib/Dialect/TestIRDLToCpp"],
272+
deps = [
273+
":test_irdl_to_cpp_gen",
274+
"//llvm:Support",
275+
"//mlir:BuiltinToLLVMIRTranslation",
276+
"//mlir:IR",
277+
"//mlir:InferTypeOpInterface",
278+
"//mlir:LLVMToLLVMIRTranslation",
279+
"//mlir:Pass",
280+
"//mlir:ToLLVMIRTranslation",
281+
"//mlir:TransformUtils",
282+
"//mlir:Transforms",
283+
"//mlir:TranslateLib",
284+
],
285+
)
286+
259287
td_library(
260288
name = "TransformDialectTdFiles",
261289
srcs = glob(["lib/Dialect/Transform/*.td"]),

0 commit comments

Comments
 (0)