-
Notifications
You must be signed in to change notification settings - Fork 341
[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
[clang][ScanDeps] cherry-pick VFS optimization fixes from upstream #8292
Conversation
4080cd9
to
bb85688
Compare
@swift-ci please test |
@swift-ci please test llvm |
There was a problem hiding this 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.
There was a problem hiding this 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.
bb85688
to
fb91767
Compare
@swift-ci please test |
@swift-ci test windows platform |
3 similar comments
@swift-ci test windows platform |
@swift-ci test windows platform |
@swift-ci test windows platform |
.Cases("pch-vfs-diff", "error=pch-vfs-diff", false) | ||
.Default(true); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
This contains llvm#82294 and an extra fix for disabling various optimizations when using include tree.