[clang] [llvm] [Support][Modules] Ensure parent directory exists in LockFileManager (PR #187372)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 27 09:39:47 PDT 2026
jansvoboda11 wrote:
This unconditionally tries to create a new directory, even if one already exists, which is an unnecessary overhead for the more common happy path. Could we move the directory creation into this block?
```c++
if (std::error_code EC = sys::fs::createUniqueFile(
UniqueLockFileName, UniqueLockFileID, UniqueLockFileName))
// NOTE: Create the directory here if we failed with "does not exist" error.
// Create it and call `createUniqueFile()` again.
return createStringError(EC, "failed to create unique file " +
UniqueLockFileName);
```
https://github.com/llvm/llvm-project/pull/187372
More information about the cfe-commits
mailing list