Skip to content

[clang][deps] Add -o flag and support single-file mode #8591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

jansvoboda11
Copy link

Cherry-pick of llvm#88764 and llvm#88767

Explanation: Improvements to the command line of the clang-scan-deps testing/utility tool.

Risk: None. This is a change only affecting a testing/utility tool that's not used during builds.

Testing: Existing LIT tests were modified to exercise the new interface.

Reviewed By: @Bigcheese, @benlangmuir

The `clang-scan-deps` tool can be used for fast scanning of batches of
compilation commands passed in via the `-compilation-database` option.
This gets awkward in our tests where we have to resort to using
`.in`/`.template` JSON files and running them through `sed` in order to
embed LIT's `%t` variable into them. However, most of our tests only
need to pass single compilation command, so this dance is entirely
unnecessary.

This patch makes sure the existing "per-file" mode (where the
compilation command is passed in-line after the `--` argument) works for
all output formats, not only `P1689`.

(cherry picked from commit eafd515)
This makes it possible to pass "-o /dev/null" to `clang-scan-deps` and
skip some potentially expensive work, making timings less noisy. Also
removes the need for stream redirection.

(cherry picked from commit 6a4eaf9)
@jansvoboda11
Copy link
Author

@swift-ci please test

@nkcsgexi nkcsgexi merged commit ef51a35 into swift/release/6.0 Apr 19, 2024
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/clang-scan-deps-niceties branch April 24, 2024 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants