[PATCH] D43511: [dsymutil] Be smarter in caching calls to realpath

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 13:05:08 PST 2018


davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D43511#1013499, @JDevlieghere wrote:

> In https://reviews.llvm.org/D43511#1013421, @davide wrote:
>
> > The meta comment I have here is whether we need to segregate this is in `dsymutil` or expose that somewhere else (e.g. in `Support/`).
>
>
> As long as only `dsymutil` is the only user of this code, I think it should live here.
>
> > My feeling is that this utility could be of more general use for pathname resolution.
>
> I agree and that's why I kept it as generic as possible. (Until I added the StringPool argument, which totally makes sense here)
>
> > Among others, `lldb` calls realpath a bit, and maybe there are components in clang doing the same. Jonas, what do you think?
>
> Is there any particular call to realpath you're thinking about? From what I saw there weren't that many call sites that would benefit from this optimization. It works very well for dsymutil, because it's not uncommon for several object files to live in the same directory. If you're resolving unrelated paths, you end up worse because of the caching overhead.


Yes, what you say makes sense. My worry was that people don't really know of the utility if it's private to a file, but I guess it also doesn't really make sense to promote to a generic library until we have more than a use case (and currently, I have none :)
This is fine by me, happy to see this in when Adrian/Fred are happy with it.


https://reviews.llvm.org/D43511





More information about the llvm-commits mailing list