[PATCH] D38937: [LLD] [COFF] Exclude certain static libraries and object files when exporting all symbols

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 15 14:31:48 PDT 2017


ruiu added a comment.

In https://reviews.llvm.org/D38937#898215, @mstorsjo wrote:

> In https://reviews.llvm.org/D38937#898214, @ruiu wrote:
>
> > At this point I feel like we should define a function `bool shouldExport(Defined *Sym)` or something, so that we can move the code to that function.
>
>
> Sounds like a good idea. How do you suggest to handle the exclude `StringSet`s in that case - recreate them in each function invocation? Or have a `static StringSet<> ExcludeSymbols` in the global scope?


I don't know if this is a good idea, but since the number of strings you need to check is small, you may be able to just iterate over the list like this?

  for (StringRef S : {"libgcc", "libgcc_s", ...})
    if (LibName == S)
      return false;


https://reviews.llvm.org/D38937





More information about the llvm-commits mailing list