[PATCH] D109720: [Bazel][mlir] Simplify test/BUILD.bazel with globs

Geoffrey Martin-Noble via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 13:25:13 PDT 2021


GMNGeoffrey created this revision.
Herald added subscribers: wenzhicui, wrengr, Chia-hungDuan, dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini.
GMNGeoffrey requested review of this revision.
Herald added subscribers: llvm-commits, stephenneuendorffer, nicolasvasilache.
Herald added a project: LLVM.

This reduces the maintenance burden by using globs, which is the
tradeoff we make in the other LLVM Bazel build files as well.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109720

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


Index: utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
@@ -33,20 +33,14 @@
 
 td_library(
     name = "TestOpTdFiles",
-    srcs = [
-        "lib/Dialect/Test/TestInterfaces.td",
-        "lib/Dialect/Test/TestOps.td",
-        "//mlir:include/mlir/Dialect/DLTI/DLTIBase.td",
-        "//mlir:include/mlir/IR/OpAsmInterface.td",
-        "//mlir:include/mlir/IR/RegionKindInterface.td",
-        "//mlir:include/mlir/IR/SymbolInterfaces.td",
-        "//mlir:include/mlir/Interfaces/CallInterfaces.td",
-        "//mlir:include/mlir/Interfaces/ControlFlowInterfaces.td",
-        "//mlir:include/mlir/Interfaces/CopyOpInterface.td",
-        "//mlir:include/mlir/Interfaces/DataLayoutInterfaces.td",
-        "//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
-    ],
+    srcs = glob(["lib/Dialect/Test/*.td"]),
     deps = [
+        "//mlir:CallInterfacesTdFiles",
+        "//mlir:ControlFlowInterfacesTdFiles",
+        "//mlir:CopyOpInterfaceTdFiles",
+        "//mlir:DLTIDialectTdFiles",
+        "//mlir:DataLayoutInterfacesTdFiles",
+        "//mlir:InferTypeOpInterfaceTdFiles",
         "//mlir:OpBaseTdFiles",
         "//mlir:SideEffectTdFiles",
     ],
@@ -196,21 +190,8 @@
 
 cc_library(
     name = "TestDialect",
-    srcs = [
-        "lib/Dialect/Test/TestAttributes.cpp",
-        "lib/Dialect/Test/TestDialect.cpp",
-        "lib/Dialect/Test/TestInterfaces.cpp",
-        "lib/Dialect/Test/TestPatterns.cpp",
-        "lib/Dialect/Test/TestTraits.cpp",
-        "lib/Dialect/Test/TestTypes.cpp",
-    ],
-    hdrs = [
-        "lib/Dialect/Test/TestAttributes.h",
-        "lib/Dialect/Test/TestDialect.h",
-        "lib/Dialect/Test/TestInterfaces.h",
-        "lib/Dialect/Test/TestTraits.h",
-        "lib/Dialect/Test/TestTypes.h",
-    ],
+    srcs = glob(["lib/Dialect/Test/*.cpp"]),
+    hdrs = glob(["lib/Dialect/Test/*.h"]),
     includes = [
         "lib/Dialect/Test",
     ],


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109720.372333.patch
Type: text/x-patch
Size: 2113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210913/398205ac/attachment.bin>


More information about the llvm-commits mailing list