[Mlir-commits] [mlir] bf09114 - [mlir][cmake][NFC] Remove duplicate `tablegen_compile_commands.yml` append (#207510)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Jul 4 05:45:15 PDT 2026


Author: Markus Böck
Date: 2026-07-04T12:45:11Z
New Revision: bf09114d6164f522508ae80921a63c5a080c183d

URL: https://github.com/llvm/llvm-project/commit/bf09114d6164f522508ae80921a63c5a080c183d
DIFF: https://github.com/llvm/llvm-project/commit/bf09114d6164f522508ae80921a63c5a080c183d.diff

LOG: [mlir][cmake][NFC] Remove duplicate `tablegen_compile_commands.yml` append (#207510)

The append-logic of the compile command is already performed by the
`tablegen` function, there is no need to replicate the logic twice.

Added: 
    

Modified: 
    mlir/cmake/modules/AddMLIR.cmake

Removed: 
    


################################################################################
diff  --git a/mlir/cmake/modules/AddMLIR.cmake b/mlir/cmake/modules/AddMLIR.cmake
index 60b73876d53fe..d3f534a02f9de 100644
--- a/mlir/cmake/modules/AddMLIR.cmake
+++ b/mlir/cmake/modules/AddMLIR.cmake
@@ -6,28 +6,6 @@ function(mlir_tablegen ofn)
   tablegen(MLIR ${ARGV})
   set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
       PARENT_SCOPE)
-
-  # Get the current set of include paths for this td file.
-  cmake_parse_arguments(ARG "" "" "DEPENDS;EXTRA_INCLUDES" ${ARGN})
-  get_directory_property(tblgen_includes INCLUDE_DIRECTORIES)
-  list(APPEND tblgen_includes ${ARG_EXTRA_INCLUDES})
-  # Filter out any empty include items.
-  list(REMOVE_ITEM tblgen_includes "")
-
-  # Build the absolute path for the current input file.
-  if (IS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
-    set(LLVM_TARGET_DEFINITIONS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
-  else()
-    set(LLVM_TARGET_DEFINITIONS_ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS})
-  endif()
-
-  # Append the includes used for this file to the tablegen_compile_commands
-  # file.
-  file(APPEND ${CMAKE_BINARY_DIR}/tablegen_compile_commands.yml
-      "--- !FileInfo:\n"
-      "  filepath: \"${LLVM_TARGET_DEFINITIONS_ABSOLUTE}\"\n"
-      "  includes: \"${CMAKE_CURRENT_SOURCE_DIR};${tblgen_includes}\"\n"
-  )
 endfunction()
 
 # Clear out any pre-existing compile_commands file before processing. This


        


More information about the Mlir-commits mailing list