jansvoboda11 created this revision. jansvoboda11 added a reviewer: Bigcheese. Herald added a subscriber: ributzka. Herald added a project: All. jansvoboda11 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
On incremental scan, caching an out-of-date PCM on the VFS layer causes each TU and each module to recompile the PCM again. This is huge performance problem. Stop caching ".pcm" files. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D150615 Files: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp Index: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp =================================================================== --- clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp +++ clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp @@ -262,6 +262,9 @@ SmallString<256> OwnedFilename; StringRef Filename = Path.toStringRef(OwnedFilename); + if (Filename.endswith(".pcm")) + return getUnderlyingFS().status(Path); + llvm::ErrorOr<EntryRef> Result = getOrCreateFileSystemEntry(Filename); if (!Result) return Result.getError(); @@ -319,6 +322,9 @@ SmallString<256> OwnedFilename; StringRef Filename = Path.toStringRef(OwnedFilename); + if (Filename.endswith(".pcm")) + return getUnderlyingFS().openFileForRead(Path); + llvm::ErrorOr<EntryRef> Result = getOrCreateFileSystemEntry(Filename); if (!Result) return Result.getError();
Index: clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp =================================================================== --- clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp +++ clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp @@ -262,6 +262,9 @@ SmallString<256> OwnedFilename; StringRef Filename = Path.toStringRef(OwnedFilename); + if (Filename.endswith(".pcm")) + return getUnderlyingFS().status(Path); + llvm::ErrorOr<EntryRef> Result = getOrCreateFileSystemEntry(Filename); if (!Result) return Result.getError(); @@ -319,6 +322,9 @@ SmallString<256> OwnedFilename; StringRef Filename = Path.toStringRef(OwnedFilename); + if (Filename.endswith(".pcm")) + return getUnderlyingFS().openFileForRead(Path); + llvm::ErrorOr<EntryRef> Result = getOrCreateFileSystemEntry(Filename); if (!Result) return Result.getError();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits