[PATCH] D103985: [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 9 13:27:04 PDT 2021
thakis 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)
----------------
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.
================
Comment at: lld/MachO/DriverUtils.cpp:192
+ if (dylibExists)
+ return std::string(dylibPath);
+
----------------
alexshap wrote:
> dylibPath.str() ?
This is just moving code around that was here previously. `std::string(...)` is how you convert a string view to a string in c++17, so I suppose this is consistent with that.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103985/new/
https://reviews.llvm.org/D103985
More information about the llvm-commits
mailing list