================ @@ -330,3 +353,20 @@ DependencyScanningWorkerFilesystem::openFileForRead(const Twine &Path) { return Result.getError(); return DepScanFile::create(Result.get()); } + +std::error_code DependencyScanningWorkerFilesystem::setCurrentWorkingDirectory( + const Twine &Path) { + updateWorkingDirForCacheLookup(Path.str()); + return ProxyFileSystem::setCurrentWorkingDirectory(Path); +} + +void DependencyScanningWorkerFilesystem::updateWorkingDirForCacheLookup( + llvm::ErrorOr<std::string> CWD) { + if (CWD && !CWD->empty()) { + WorkingDirForCacheLookup = *CWD; + } else { + // The cache lookup functions will not accept relative paths for safety, so + // at least make it absolute from a "root". + WorkingDirForCacheLookup = "/"; ---------------- akyrtzi wrote:
See latest commit, I've changed it so it became `llvm::ErrorOr<std::string> WorkingDirForCacheLookup` and `DependencyScanningWorkerFilesystem::getOrCreateFileSystemEntry()` errors out if it needs to use `WorkingDirForCacheLookup` and it's erroneous. https://github.com/llvm/llvm-project/pull/66122 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits