[PATCH] D80677: [lld-macho] Handle framework search path, alongside library search path

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 18:02:23 PDT 2020


int3 added inline comments.


================
Comment at: lld/MachO/Config.h:31
+  std::vector<llvm::StringRef> librarySearchPaths;
+  std::vector<llvm::StringRef> frameworkSearchPaths;
   llvm::DenseMap<llvm::StringRef, SymbolPriorityEntry> priorities;
----------------
maybe add a TODO to indicate this isn't currently used


================
Comment at: lld/MachO/Driver.cpp:103
+static void checkSearchDirs(StringRef option, std::vector<StringRef> &paths) {
+  for (const auto &path : paths) {
+    if (!fs::exists(path))
----------------
not a big deal, but how about erasing the invalid paths from the list?

though if we aren't doing that we should take `paths` by const ref at least


================
Comment at: lld/test/MachO/search-paths.test:6
+RUN: lld -flavor darwinnew -v -L%t1 -L %t2 -L%t3 -L %t4 -F%t5 -F %t6 -F%t7 -F %t8 2>&1 \
+RUN: | FileCheck -DT1=%t1 -DT2=%t2 -DT3=%t3 -DT4=%t4 -DT5=%t5 -DT6=%t6 -DT7=%t7 -DT8=%t8 --check-prefix=CHECK_noZ %s
+
----------------
nit: do we really need 8 paths? wouldn't a test with one or two library/framework paths respectively be sufficient?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80677





More information about the llvm-commits mailing list