[PATCH] D120913: [NFC][llvm-nm] create a new helper function exportSymbolNamesFromFiles for --export-symbols

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 8 09:52:29 PST 2022


DiggerLin added inline comments.


================
Comment at: llvm/tools/llvm-nm/llvm-nm.cpp:2278
+  SymbolList.erase(
+      std::remove_if(SymbolList.begin(), SymbolList.end(),
+                     [](const NMSymbol &s) { return !s.shouldPrint(); }),
----------------
jhenderson wrote:
> DiggerLin wrote:
> > jhenderson wrote:
> > > Use `llvm::remove_if(SymbolList, ...)`
> > there is no api llvm::remove_if(SymbolList, ...) as https://en.cppreference.com/w/cpp/algorithm/remove
> > and if you use the llvm::remove_if(SymbolList, ...) it will compile error. 
> `llvm::remove_if` is a wrapper around `std::remove_if`: https://github.com/llvm/llvm-project/blob/eddd94c27df609113af1d1b795d8483aa6dd662c/llvm/include/llvm/ADT/STLExtras.h#L1623
thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120913



More information about the llvm-commits mailing list