Skip to content

Commit 513232f

Browse files
authored
[clang][deps] Track VFS overlay files in file dependencies. (#167824)
rdar://164612831
1 parent a6edeed commit 513232f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,9 @@ void ModuleDepCollectorPP::EndOfMainFile() {
616616
if (!MDC.ScanInstance.getPreprocessorOpts().ImplicitPCHInclude.empty())
617617
MDC.addFileDep(MDC.ScanInstance.getPreprocessorOpts().ImplicitPCHInclude);
618618

619+
for (StringRef VFS : MDC.ScanInstance.getHeaderSearchOpts().VFSOverlayFiles)
620+
MDC.addFileDep(VFS);
621+
619622
for (const Module *M :
620623
MDC.ScanInstance.getPreprocessor().getAffectingClangModules())
621624
if (!MDC.isPrebuiltModule(M))

clang/test/ClangScanDeps/modules-header-sharing.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
// CHECK: ],
8080
// CHECK: "file-deps": [
8181
// CHECK-NEXT: "[[PREFIX]]/tu.m",
82-
// CHECK-NEXT: "[[PREFIX]]/shared/H.h"
82+
// CHECK-NEXT: "[[PREFIX]]/shared/H.h",
83+
// CHECK-NEXT: "[[PREFIX]]/overlay.json"
8384
// CHECK-NEXT: ],
8485
// CHECK-NEXT: "input-file": "[[PREFIX]]/tu.m"
8586
// CHECK-NEXT: }

0 commit comments

Comments
 (0)