[PATCH] D75477: [MLIR] Force generation of tabelgen'd headers before Dialects.

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 13:44:01 PST 2020


stephenneuendorffer created this revision.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini, mgorny.
Herald added a project: LLVM.
stephenneuendorffer added a reviewer: mehdi_amini.

Dialects often depend on the public interface exposed from other
dialects, by including their header files.  However, these header files
are often automatically generated.  In order to avoid explicitly
specifying dialect dependencies in all dialect cmakefiles, we
(conservatively) assert that all automatically generated headers
need to be built before any dialect.  This avoids build errors which
are difficult to identify because of incorrectly specified dependencies
and avoids transitive dependencies between dialects to be specified
in the build system.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75477

Files:
  mlir/cmake/modules/AddMLIR.cmake


Index: mlir/cmake/modules/AddMLIR.cmake
===================================================================
--- mlir/cmake/modules/AddMLIR.cmake
+++ mlir/cmake/modules/AddMLIR.cmake
@@ -53,10 +53,12 @@
 function(add_mlir_dialect_library name)
   set_property(GLOBAL APPEND PROPERTY MLIR_DIALECT_LIBS ${name})
   add_llvm_library(${ARGV})
+  add_dependencies(${name} mlir-headers)
 endfunction(add_mlir_dialect_library)
 
 # Declare the library associated with a conversion.
 function(add_mlir_conversion_library name)
   set_property(GLOBAL APPEND PROPERTY MLIR_CONVERSION_LIBS ${name})
   add_llvm_library(${ARGV})
+  add_dependencies(${name} mlir-headers)
 endfunction(add_mlir_conversion_library)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75477.247718.patch
Type: text/x-patch
Size: 700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200302/f2149cc6/attachment.bin>


More information about the llvm-commits mailing list