[PATCH] D36351: [lld][ELF] Add profile guided section layout

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 04:23:29 PDT 2017


grimar added inline comments.


================
Comment at: ELF/Writer.cpp:996
+      } else
+        ++EI;
+    }
----------------
You missing curly braces:
```
else {
  ++EI;
}
```


================
Comment at: ELF/Writer.cpp:1012
+  // Generate order.
+  llvm::DenseMap<const InputSectionBase *, std::size_t> OrderMap;
+  ssize_t CurOrder = 0;
----------------
We do not place `std::` before `size_t` usually.


================
Comment at: ELF/Writer.cpp:1020
+      OrderMap[IS] = CurOrder++;
+  }
+  for (BaseCommand *Base : Script->Opt.Commands) {
----------------
You do not need `continue`:

```
  for (const Node &N : Nodes)
    for (const InputSectionBase *IS : N.Sections)
      OrderMap[IS] = CurOrder++;
```


================
Comment at: test/ELF/cgprofile.s:1
+# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
+# RUN: ld.lld %t1 -e a -o %t -callgraph-ordering-file %p/Inputs/cgprofile.txt
----------------
```
# REQUIRES: x86
```


Repository:
  rL LLVM

https://reviews.llvm.org/D36351





More information about the llvm-commits mailing list