[llvm] [clang] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 13:31:42 PST 2024


================
@@ -4687,6 +4699,15 @@ void ASTWriter::collectNonAffectingInputFiles() {
   NonAffectingFileIDAdjustments.push_back(FileIDAdjustment);
   NonAffectingOffsetAdjustments.push_back(OffsetAdjustment);
 
+  const bool IncludeVFSUsage =
+      PP->getHeaderSearchInfo().getHeaderSearchOpts().ModulesIncludeVFSUsage;
+  FileManager &FileMgr = PP->getFileManager();
+  FileMgr.trackVFSUsage(true);
----------------
jansvoboda11 wrote:

The scope of tracking is fairly long. Instead of intertwining it with the logic for finding affecting files and constructing the offset adjustment table, I think it would be clearer to have a separate loop at the end of this function:

```c++
if (IncludeVFSUsage)
  for (unsigned I = 1; I != N; ++I)
    if (IsSLocAffecting[I]) {
      SrcMgr::FileInfo File = /*...*/;
      FileMgr.getVirtualFileSystem().exists(
            File.getContentCache().OrigEntry->getNameAsRequested());
    }
```

https://github.com/llvm/llvm-project/pull/73734


More information about the cfe-commits mailing list