Skip to content

Commit 8dcf34d

Browse files
committed
Fix libclang build
1 parent c73ef9a commit 8dcf34d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/tools/libclang/CDependencies.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,14 @@ enum CXErrorCode clang_experimental_DependencyScanner_generateReproducer(
856856
for (const Command &BuildCommand : TU.Commands)
857857
PrintArguments(ScriptOS, BuildCommand.Arguments);
858858

859+
auto RealFS = llvm::vfs::getRealFileSystem();
860+
RealFS->setCurrentWorkingDirectory(*Opts.WorkingDirectory);
861+
859862
SmallString<128> VFSCachePath = FileCachePath;
860863
llvm::sys::path::append(VFSCachePath, "vfs");
861864
std::string VFSCachePathStr = VFSCachePath.str().str();
862865
llvm::FileCollector FileCollector(VFSCachePathStr,
863-
/*OverlayRoot=*/VFSCachePathStr);
866+
/*OverlayRoot=*/VFSCachePathStr, RealFS);
864867
for (const auto &FileDep : TU.FileDeps) {
865868
FileCollector.addFile(FileDep);
866869
}

0 commit comments

Comments
 (0)