https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/102540
This patch stops adjustments of the module cache path beyond what is done in `ParseHeaderSearchArgs` (making it absolute and removing dots). This enables more efficient implementation of the caching VFS in https://github.com/llvm/llvm-project/pull/88800. >From 599407b7d358a3f2e7979af67d6e4ee85e6d8dfb Mon Sep 17 00:00:00 2001 From: Jan Svoboda <jan_svob...@apple.com> Date: Tue, 16 Apr 2024 11:31:13 -0700 Subject: [PATCH] [clang] Stop adjusting the module cache path This patch stops adjustments of the module cache path beyond what is done in `ParseHeaderSearchArgs` (making it absolute and removing dots). This enables more efficient implementation of the caching VFS in https://github.com/llvm/llvm-project/pull/88800. --- clang/lib/Frontend/CompilerInstance.cpp | 5 ++--- clang/lib/Lex/HeaderSearch.cpp | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 6242b5a7d9fe39..1364641a9b71e1 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1659,9 +1659,8 @@ static void pruneModuleCache(const HeaderSearchOptions &HSOpts) { // Walk the entire module cache, looking for unused module files and module // indices. std::error_code EC; - SmallString<128> ModuleCachePathNative; - llvm::sys::path::native(HSOpts.ModuleCachePath, ModuleCachePathNative); - for (llvm::sys::fs::directory_iterator Dir(ModuleCachePathNative, EC), DirEnd; + for (llvm::sys::fs::directory_iterator Dir(HSOpts.ModuleCachePath, EC), + DirEnd; Dir != DirEnd && !EC; Dir.increment(EC)) { // If we don't have a directory, there's nothing to look into. if (!llvm::sys::fs::is_directory(Dir->path())) diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index d2210e7e18628a..4914c10e62d0c5 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -267,7 +267,6 @@ std::string HeaderSearch::getCachedModuleFileNameImpl(StringRef ModuleName, return {}; SmallString<256> Result(CachePath); - llvm::sys::fs::make_absolute(Result); if (HSOpts->DisableModuleHash) { llvm::sys::path::append(Result, ModuleName + ".pcm"); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits