Skip to content

Commit 17dc43d

Browse files
authored
[clang] Stop adjusting the module cache path (#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 #88800.
1 parent 1ae507d commit 17dc43d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

clang/lib/Frontend/CompilerInstance.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,9 +1659,8 @@ static void pruneModuleCache(const HeaderSearchOptions &HSOpts) {
16591659
// Walk the entire module cache, looking for unused module files and module
16601660
// indices.
16611661
std::error_code EC;
1662-
SmallString<128> ModuleCachePathNative;
1663-
llvm::sys::path::native(HSOpts.ModuleCachePath, ModuleCachePathNative);
1664-
for (llvm::sys::fs::directory_iterator Dir(ModuleCachePathNative, EC), DirEnd;
1662+
for (llvm::sys::fs::directory_iterator Dir(HSOpts.ModuleCachePath, EC),
1663+
DirEnd;
16651664
Dir != DirEnd && !EC; Dir.increment(EC)) {
16661665
// If we don't have a directory, there's nothing to look into.
16671666
if (!llvm::sys::fs::is_directory(Dir->path()))

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ std::string HeaderSearch::getCachedModuleFileNameImpl(StringRef ModuleName,
267267
return {};
268268

269269
SmallString<256> Result(CachePath);
270-
llvm::sys::fs::make_absolute(Result);
271270

272271
if (HSOpts->DisableModuleHash) {
273272
llvm::sys::path::append(Result, ModuleName + ".pcm");

0 commit comments

Comments
 (0)