[PATCH] D103423: [lld/mac] Don't load DylibFiles from the DylibFile constructor
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 31 15:19:44 PDT 2021
thakis added inline comments.
================
Comment at: lld/MachO/DriverUtils.cpp:204
CachedHashStringRef path(mbref.getBufferIdentifier());
- DylibFile *file = loadedDylibs[path];
+ DylibFile *&file = loadedDylibs[path];
if (file)
----------------
tschuett wrote:
> Do you really the cute `&` hack? Can't you always do `loadedLibs[Path] = file;`
It's the canonical way to write a caching function. So my thinking was we need to have a comment about this so that nobody changes this to using a reference naively, and if we have to add the comment anyways we might as well take what the comment pays for. But I don't feel terribly strongly about it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103423/new/
https://reviews.llvm.org/D103423
More information about the llvm-commits
mailing list