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 {
150150
151151 llvm::vfs::FileSystem &RootFS = FileMgr.getVirtualFileSystem ();
152152 // 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.
154155 RootFS.visit ([&](llvm::vfs::FileSystem &FS) {
155156 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+ }
158164 }
159165 });
160166 assert (VFSUsage.size () == getHeaderSearchOpts ().VFSOverlayFiles .size () &&
You can’t perform that action at this time.
0 commit comments