[PATCH] D103662: [lld][MachO] Fix function starts section

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 20:38:37 PDT 2021


gkm added inline comments.


================
Comment at: lld/MachO/SyntheticSections.cpp:602-610
+      addrs.push_back(defined->getVA());
     }
   }
+  llvm::sort(addrs);
+  uint64_t addr = in.header->addr;
+  for (uint64_t nextAddr : addrs) {
+    uint64_t delta = nextAddr - addr;
----------------
Using `std::set<uint64_t>` and its iterator (which is ordered) will make for much more compact code, and the performance might be comparable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103662



More information about the llvm-commits mailing list