[PATCH] D144153: [lld-macho] Support re-exports of individual symbols

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 12:53:52 PDT 2023


int3 added a comment.

I don't really think a test for that is super necessary, the `-exported_symbols_list` is simply command-line sugar over `-exported_symbol`, and I don't think every variation of how `-exported_symbol` gets used needs to have a corresponding `_list` test...



================
Comment at: lld/MachO/SyntheticSections.cpp:982-983
+    } else if (auto *dysym = dyn_cast<DylibSymbol>(sym)) {
+      if (config->hasExplicitExports && config->exportedSymbols.match(sym->getName()))
+        trieBuilder.addSymbol(*dysym);
     }
----------------
smeenai wrote:
> What do you think of moving this logic to `handleExplicitExports` in Driver.cpp and setting a flag on the DylibSymbol that's checked here instead? I ask because that one is parallelized, which presumably means that provided a measurable speedup in some builds, plus it seems conceptually nicer to handle the checking in one place.
ooh, that's definitely cleaner. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144153



More information about the llvm-commits mailing list