[PATCH] D112164: [lld-macho] Port CallGraphSort from COFF/ELF

Leonard Grey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 20 11:14:19 PDT 2021


lgrey added inline comments.


================
Comment at: lld/MachO/CallGraphSort.cpp:152
+DenseMap<const InputSection *, size_t> CallGraphSort::run() {
+  const uint64_t maxClusterSize = target->getPageSize();
+
----------------
ELF/COFF use a larger constant but the original paper says page size and I couldn't find anything in history/reviews that motivates the larger number.


================
Comment at: lld/MachO/InputFiles.cpp:308
+      if (name == "__cg_profile" && config->callGraphProfileSort) {
+        BinaryStreamReader reader(data, support::little);
+        while (!reader.empty()) {
----------------
I couldn't find prior art on finding endianness, though there's code elsewhere that assumes little. Is there a better way to do this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112164



More information about the llvm-commits mailing list