[PATCH] D103985: [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 16:25:24 PDT 2021


int3 added inline comments.


================
Comment at: lld/MachO/DriverUtils.cpp:179
 
-Optional<std::string> macho::resolveDylibPath(StringRef path) {
-  // TODO: if a tbd and dylib are both present, we should check to make sure
-  // they are consistent.
-  if (fs::exists(path))
-    return std::string(path);
-  else
+static void searchedDylib(const Twine &path, bool found) {
+  if (config->printDylibSearch)
----------------
thakis wrote:
> int3 wrote:
> > alexshap wrote:
> > > thakis wrote:
> > > > alexshap wrote:
> > > > > perhaps, logDylibSearchResult would be a better name ?
> > > > > also - maybe use StringRef instead of Twine ?
> > > > The last caller in this file passes a Twine, so StringRef doesn't work.
> > > > 
> > > > I like the shorter name.
> > > I think readability of the code matters, not sure if "searchedDylib" is a sufficiently descriptive name
> > "logSearchedDylib"? I'm fine with anything, but I'd prefer not to have Java-length verbosity
> Maybe `didSearchDylib`?
eh, that has the same information as `searchedDylib` but is one character longer :p "log" describes what it's doing at least


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103985/new/

https://reviews.llvm.org/D103985



More information about the llvm-commits mailing list