[Mlir-commits] [mlir] [mlir][cmake][NFC] Remove duplicate `tablegen_compile_commands.yml` append (PR #207510)
Markus Böck
llvmlistbot at llvm.org
Sat Jul 4 05:28:57 PDT 2026
https://github.com/zero9178 created https://github.com/llvm/llvm-project/pull/207510
The append-logic of the compile command is already performed by the `tablegen` function, there is no need to replicate the logic twice.
>From 49585d4ba278b601fe36b748c51dc7ff5bb8b787 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20B=C3=B6ck?= <markus.boeck02 at gmail.com>
Date: Sat, 4 Jul 2026 14:25:16 +0200
Subject: [PATCH] [mlir][cmake][NFC] Remove duplicate
`tablegen_compile_commands.yml` append
The append-logic of the compile command is already performed by the `tablegen` function, there is no need to replicate the logic twice.
---
mlir/cmake/modules/AddMLIR.cmake | 22 ----------------------
1 file changed, 22 deletions(-)
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