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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits