[PATCH] D133218: [lld-macho] Hardlink -object_path_lto files to cache when possible
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 3 07:57:11 PDT 2022
thakis accepted this revision.
thakis added a comment.
This revision is now accepted and ready to land.
Cool, thanks!
Should we try to test this? Say, with a `REQUIRES: shell` line (to rule out Windows which can't hardlink files without admin) and `ls -l somefile | cut -f 3 -d ' '` and check that this link count is 2?
================
Comment at: lld/MachO/LTO.cpp:60
+ if (originalPath) {
+ if (!fs::create_hard_link(*originalPath, path))
+ return;
----------------
nit: To make it more clear that this isn't a function that returns a success bool, I'd write this as:
```
autor err = fs::create_hard_link(*originalPath, path);
if (!err)
return;
```
(I assumed `create_hard_link` returns true on success and false on failure and the wondered why we'd return on failure here.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133218/new/
https://reviews.llvm.org/D133218
More information about the llvm-commits
mailing list