Skip to content

[clang][ScanDeps] cherry-pick VFS optimization fixes from upstream #8292

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
Mar 1, 2024

Conversation

Bigcheese
Copy link

This contains llvm#82294 and an extra fix for disabling various optimizations when using include tree.

@Bigcheese
Copy link
Author

@swift-ci please test

@Bigcheese
Copy link
Author

@swift-ci please test llvm

Copy link

@jansvoboda11 jansvoboda11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with couple suggestions.

Copy link

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment on the upstream PR, but the additional downstream CAS change LGTM

…e tree

The FullIncludeTree output format completely subsumes header search and
VFS optimizations due to how it works. Disable these optimizations so
we're not doing unneeded work.

Also test that FullIncludeTree handles VFSs correctly when emitting
diagnostics.
It turns out it's not that uncommon for real code to pass a different
set of VFSs while building a PCH than while using the PCH. This can
cause problems as seen in `test/ClangScanDeps/optimize-vfs-pch.m`. If
you scan `compile-commands-tu-no-vfs-error.json` without -Werror and
run the resulting commands, Clang will emit a fatal error while trying
to emit a note saying that it can't find a remapped header.

This also adds textual tracking of VFSs for prebuilt modules that are
part of an included PCH, as the same issue can occur in a module we
are building if we drop VFSs. This has to be textual because we have
no guarantee the PCH had the same list of VFSs as the current TU.
@Bigcheese
Copy link
Author

@swift-ci please test

@Bigcheese
Copy link
Author

@swift-ci test windows platform

3 similar comments
@Bigcheese
Copy link
Author

@swift-ci test windows platform

@Bigcheese
Copy link
Author

@swift-ci test windows platform

@Bigcheese
Copy link
Author

@swift-ci test windows platform

@Bigcheese Bigcheese merged commit 2eabcea into swiftlang:stable/20230725 Mar 1, 2024
Comment on lines +222 to +223
.Cases("pch-vfs-diff", "error=pch-vfs-diff", false)
.Default(true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llvm#82294 has an extra .StartsWith("no-error=", false) in here. Was there a reason for not including it? In my testing it seems to be necessary to avoid a test failure in ClangScanDeps/diagnostics.c, which checks for -no-error= being ignored.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahmishal: did something change about "please test llvm"? I am looking at the logs in https://ci.swift.org/view/Pull%20Requests/job/apple-llvm-project-pr-macos/ and only LLDB tests seem to run during those? I cannot find the LLVM or Clang tests (but the logs are 134MB, so I might be not looking in the right place).

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.

4 participants