[PATCH] D127562: [lld-macho] Add support for exporting no symbols

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 02:48:40 PDT 2022


int3 accepted this revision.
int3 added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: lld/MachO/Driver.cpp:1411
                        OPT_unexported_symbols_list);
-  if (!config->exportedSymbols.empty() && !config->unexportedSymbols.empty()) {
+  if (config->hasExplicitExports && !config->unexportedSymbols.empty()) {
     error("cannot use both -exported_symbol* and -unexported_symbol* options\n"
----------------
no need for `{ }` here and line 1416 below


================
Comment at: lld/MachO/Driver.cpp:1415-1416
     error("cannot use both -exported_symbol* and -unexported_symbol* options\n"
           ">>> ignoring unexports");
     config->unexportedSymbols.clear();
   }
----------------
keith wrote:
> int3 wrote:
> > tangential & existing code, but this seems kind of redundant to me lol. We're already erroring out, doesn't seem like there's a need to tell the user we're ignoring `unexports`. (Not sure there's a need to clear the unexported symbols list either, but I suppose it might make any subsequent error messages less confusing.)
> Removed this, it was silently ignored anyways because of the order of the if statement below. If we find a case where error messages are degraded without it I guess we should add it back with a test showing that case.
nice. can we remove the `">>> ignoring unexports"` string as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127562



More information about the llvm-commits mailing list