[PATCH] D114841: [lld-macho] Fix duplicate symbols with relocatable objects

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 13:28:55 PST 2022


int3 added a comment.

yeah, a more limited-scope change seems like a good idea :)



================
Comment at: lld/MachO/Driver.cpp:391
 
+static DenseSet<StringRef> loadedContainerFrameworks;
 static void addFramework(StringRef name, bool isNeeded, bool isWeak,
----------------
Q: why the name "container"?


================
Comment at: lld/MachO/Driver.cpp:402
+    file_magic magic = identify_magic((*buffer).getBuffer());
+    switch (magic) {
+    case file_magic::macho_object:
----------------
is this cleaner than caching all frameworks, regardless of file type? Or would we actually behave differently if this cached all files?

(just curious, not asking you to change it. But we should probably have a comment here about why we're only caching object and bitcode files)


================
Comment at: lld/MachO/Driver.cpp:425
     }
+    if (cacheLoad && file) {
+      loadedContainerFrameworks.insert(*path);
----------------
nit: no need for braces


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114841



More information about the llvm-commits mailing list