File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,17 @@ std::vector<bool> HeaderSearch::collectVFSUsageAndClear() const {
150
150
151
151
llvm::vfs::FileSystem &RootFS = FileMgr.getVirtualFileSystem ();
152
152
// TODO: This only works if the `RedirectingFileSystem`s were all created by
153
- // `createVFSFromOverlayFiles`.
153
+ // `createVFSFromOverlayFiles`. But at least exclude the ones with null
154
+ // OverlayFileDir.
154
155
RootFS.visit ([&](llvm::vfs::FileSystem &FS) {
155
156
if (auto *RFS = dyn_cast<llvm::vfs::RedirectingFileSystem>(&FS)) {
156
- VFSUsage.push_back (RFS->hasBeenUsed ());
157
- RFS->clearHasBeenUsed ();
157
+ // Skip a `RedirectingFileSystem` with null OverlayFileDir which indicates
158
+ // that they aren't created by createVFSFromOverlayFiles from the overlays
159
+ // in HeaderSearchOption::VFSOverlayFiles.
160
+ if (!RFS->getOverlayFileDir ().empty ()) {
161
+ VFSUsage.push_back (RFS->hasBeenUsed ());
162
+ RFS->clearHasBeenUsed ();
163
+ }
158
164
}
159
165
});
160
166
assert (VFSUsage.size () == getHeaderSearchOpts ().VFSOverlayFiles .size () &&
You can’t perform that action at this time.
0 commit comments