Skip to content

[clang][DependencyScanner] Remove unused -ivfsoverlay files #8095

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

Conversation

Bigcheese
Copy link

This is a cherry-pick of llvm#73734 into stable/20230725.

There are also two other commits:

  • [clang][scan-deps] Stop scanning if any scanning setup emits an error
    • This is a followup commit that fixes a case where we would scan even though we couldn't find a VFS file.
  • [clang][HeaderSearch] Use getNameAsRequested
    • Fixes a difference between stable/20230725 and main where we used the incorrect path to find a module from its header.

Using getName has the wrong behavior for VFSs, as it uses the external
name, thus not using the VFS when looking up the modulemap.

This differs in various downstreams, but has been fixed properly in
llvm/main. Some commit hashes for context:
72cf785051fb1
e2cf37ce48df7
92c2507d3ceb3
b092f41

rdar://problem/24116019
Without this scanning will continue and later hit an assert that the
number of `RedirectingFileSystem`s matches the number of -ivfsoverlay
arguments.

(cherry picked from commit b21a2f9)
`-ivfsoverlay` files are unused when building most modules. Enable
removing them by,
* adding a way to visit the filesystem tree with extensible RTTI to
  access each `RedirectingFileSystem`.
* Adding tracking to `RedirectingFileSystem` to record when it
  actually redirects a file access.
* Storing this information in each PCM.

Usage tracking is only enabled when iterating over the source manager
and affecting modulemaps. Here each path is stated to cause an access.
During scanning these stats all hit the cache.

llvm#73734
rdar://118030978
@Bigcheese
Copy link
Author

@swift-ci test

@Bigcheese Bigcheese merged commit 136fc48 into swiftlang:stable/20230725 Feb 7, 2024
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