[PATCH] D16005: Display detailed profile summary in llvm-profdata tool

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 17:30:27 PST 2016


vsk added inline comments.

================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:45
@@ +44,3 @@
+// counts). The N in the above Top-N is the NumBlocks of the triplet and the
+// smallest count in the Top-N is the MinBlockCount.
+struct ProfileSummaryEntry {
----------------
Fair enough. Maybe comments on the fields could help trim down the long-form comment?

================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:109
@@ +108,3 @@
+  // CountFrequencies is sorted in the descending order of keys (counts).
+  for (auto Entry : CountFrequencies) {
+    uint64_t Count = Entry.first;
----------------
davidxl wrote:
> current accumuated count can be passed to the Accumator methods. I think vsk's suggestion makes the code slightly more readable.
You could use a lambda to capture the map iterator, or go with David's suggestion. I imagine both would be clean. I'm mostly concerned about avoiding the 'double-break' pattern, and would prefer less direct manipulation of iterator objects.


http://reviews.llvm.org/D16005





More information about the llvm-commits mailing list