Repository navigation
[TableGen] Emit the primary input file in -d depfile output - #23012
Merged
Merged
Conversation
This fixes a bug where old, but still supported, versions of CMake and ninja perpetually consider zero-include tablegen files to be out of date. It also matches what Clang and GCC do for regular C compilations. When a .td input has no `include` directives, the depfile produced by `-d` contains only `<output>:` followed by zero dependencies. My version (3.27) of CMake's `cmake_transform_depfile` step then writes a 0-byte file, which old versions of ninja treat as a missing depfile and re-run the rule on every incremental build (e.g. Attributes.td, ValueTypes.td). Here's the effect on Attributes.inc.d: ``` $ cat ./build/include/llvm/IR/Attributes.inc.d Attributes.inc: $ cat ./build/include/llvm/IR/Attributes.inc.d Attributes.inc: /work/llvm-project/llvm/include/llvm/IR/Attributes.td ``` An LLM was used to help create this change. --- Backport of llvm/llvm-project@05c0db7
Test Results 23 files 23 suites 3d 16h 54m 31s ⏱️ Results for commit 6416d8f. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a bug where old, but still supported, versions of CMake and ninja perpetually consider zero-include tablegen files to be out of date. It also matches what Clang and GCC do for regular C compilations.
When a .td input has no
includedirectives, the depfile produced by-dcontains only<output>:followed by zero dependencies. My version (3.27) of CMake'scmake_transform_depfilestep then writes a 0-byte file, which old versions of ninja treat as a missing depfile and re-run the rule on every incremental build (e.g. Attributes.td, ValueTypes.td).Here's the effect on Attributes.inc.d:
An LLM was used to help create this change.
Backport of llvm/llvm-project@05c0db7