[PATCH] D130137: [lld-macho] Simplify archive loading logic

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 18:26:44 PDT 2022


thakis added inline comments.


================
Comment at: lld/MachO/Driver.cpp:299
       // using the cached archive should be enough
-      if (entry->second.isCommandLineLoad ||
-          entry->second.isCommandLineLoad == isCommandLineLoad)
+      if (entry->second.isCommandLineLoad || isCommandLineLoad == false)
         return file;
----------------
`!isCommandLineLoad` instead of `== false`


================
Comment at: lld/MachO/Driver.cpp:304
+    bool isLCLinkerForceLoad = loadType == LoadType::LCLinkerOption &&
+                               config->forceLoadSwift &&
+                               path::filename(path).startswith("libswift");
----------------
Why `&& forceLoadSwift && path::filename(path).startswith("libswift")`? Does this in LC_LINKER_OPTIONS only apply to swift archives?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130137



More information about the llvm-commits mailing list