[PATCH] D98223: [lld-macho] implement options -(un)exported_symbol(s_list)
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 10 06:23:19 PST 2021
thakis added inline comments.
================
Comment at: lld/MachO/SyntheticSections.cpp:611
+ continue;
+ }
trieBuilder.addSymbol(*defined);
----------------
thakis wrote:
> This looks very branch and nested. How about:
>
> ```
> static bool shouldExportSymbol(const Defined& defined) {
> if (!config->exportedSymbols.empty())
> return config->exportedSymbols.match(defined->getName());
>
> return defined->privateExtern ||
> config->unexportedSymbols.match(defined->getName());
> }
>
> ...
>
> if (!shouldExportSymbol(*defined))
> continue;
> ...
> ```
>
> ? This would also help with the issue below:
*very branchY and nested
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98223/new/
https://reviews.llvm.org/D98223
More information about the llvm-commits
mailing list