[PATCH] D108428: [ifs] Add option to hide undefined symbols

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 21 13:02:54 PDT 2021


phosek added a comment.

Would it be possible to include a test for this option?



================
Comment at: llvm/lib/InterfaceStub/IFSHandler.cpp:333-334
+                          bool Weak) {
+  std::vector<IFSSymbol>::iterator it = Stub.Symbols.begin();
+  while (it != Stub.Symbols.end()) {
+    if ((Type != IFSSymbolType::Unknown && Type == it->Type) ||
----------------
I'd use a `for` loop here.


================
Comment at: llvm/lib/InterfaceStub/IFSHandler.cpp:337
+        (Undefined && it->Undefined) || (Weak && it->Weak)) {
+      Stub.Symbols.erase(it);
+    } else {
----------------
You need to update `it` since the iterator will be invalidated by the `erase` operation.


================
Comment at: llvm/tools/llvm-ifs/llvm-ifs.cpp:434-436
+    if (StripUndefinedSymbol) {
+      stripIFSSymbols(Stub, IFSSymbolType::Unknown, true, false);
+    }
----------------
No need for braces.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108428



More information about the llvm-commits mailing list