diff --git a/BUILD b/BUILD index 3564959..cb633fa 100644 --- a/BUILD +++ b/BUILD @@ -129,6 +129,20 @@ cc_binary( "tools/mlir-tblgen-builder/*.cpp", "tools/mlir-tblgen-builder/TableGen/*.h", "tools/mlir-tblgen-builder/TableGen/*.cpp", + ]), + deps = [ + "@llvm-project//mlir:MlirTableGenMain", + "@llvm-project//mlir:Support", + "@llvm-project//mlir:IR", + "@llvm-project//llvm:Support", + "@llvm-project//llvm:TableGen", + "@llvm-project//llvm:config", + ], +) + +cc_library( + name = "mlir-hlo-builder", + srcs = glob([ "tools/mlir-tblgen-builder/Builder/*.h", "tools/mlir-tblgen-builder/Builder/*.cpp", ]), @@ -142,6 +156,23 @@ cc_binary( ], ) +cc_test( + name = "mlir-tblgen-builder-basic", + srcs = [ + "tests/mlir-tblgen-builder/test_basic.cpp", + ], + deps = [ + ":hlo_ops_builder_gen", + ":mlir-hlo-builder", + "@llvm-project//mlir:MlirTableGenMain", + "@llvm-project//mlir:Support", + "@llvm-project//mlir:IR", + "@llvm-project//llvm:Support", + "@llvm-project//llvm:TableGen", + "@llvm-project//llvm:config", + ], +) + gentbl_cc_library( name = "hlo_ops_builder_gen", strip_include_prefix = "include", @@ -561,7 +592,6 @@ cc_library( ":hlo_ops_base_structs", ":hlo_ops_common", ":hlo_ops_inc_gen", - ":hlo_ops_builder_gen", ":hlo_ops_pattern_gen", ":infer_fusibility_op_interface", "@llvm-project//llvm:Support", diff --git a/tests/mlir-tblgen-builder/test_basic.cpp b/tests/mlir-tblgen-builder/test_basic.cpp new file mode 100644 index 0000000..a209305 --- /dev/null +++ b/tests/mlir-tblgen-builder/test_basic.cpp @@ -0,0 +1,12 @@ +#include "include/mlir-hlo/Dialect/mhlo/IR/hlo_builder.h.inc" +#include "tools/mlir-tblgen-builder/Builder/Attribute.h" +#include "tools/mlir-tblgen-builder/Builder/Builder.h" +#include "tools/mlir-tblgen-builder/Builder/Op.h" +#include "tools/mlir-tblgen-builder/Builder/PrimitiveType.h" +#include "tools/mlir-tblgen-builder/Builder/Shape.h" +#include "tools/mlir-tblgen-builder/Builder/Tensor.h" + +int main() { + builder::Integer i(322); + return 0; +} diff --git a/tools/mlir-tblgen-builder/Builder/Op.h b/tools/mlir-tblgen-builder/Builder/Op.h index debdc4f..1784c5a 100644 --- a/tools/mlir-tblgen-builder/Builder/Op.h +++ b/tools/mlir-tblgen-builder/Builder/Op.h @@ -11,7 +11,7 @@ class Op { private: std::shared_ptr impl_; -} +}; } // namespace builder #endif \ No newline at end of file