[PATCH] D49659: [gcov] Fix wrong line hit counts when multiple blocks are on the same line

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 30 10:26:00 PDT 2018


vsk added a comment.

Thanks for working on this!



================
Comment at: lib/ProfileData/GCOV.cpp:454
+/// Get the count for the detected cycle
+uint64_t GCOVBlock::cycle(const Edges &Path) {
+  uint64_t CycleCount = std::numeric_limits<uint64_t>::max();
----------------
Please use verb-like function names which describe the function's action, and end sentences in comments with periods (http://www.llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly).


================
Comment at: lib/ProfileData/GCOV.cpp:466
+/// Unblock a vertex previously marked as blocked
+void GCOVBlock::unblock(const GCOVBlock *U, BlockVector &Blocked, BlockVectorLists &BlockLists) {
+  auto it = std::find(Blocked.begin(), Blocked.end(), U);
----------------
Please apply clang-format over your changes (https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting).


================
Comment at: lib/ProfileData/GCOV.cpp:467
+void GCOVBlock::unblock(const GCOVBlock *U, BlockVector &Blocked, BlockVectorLists &BlockLists) {
+  auto it = std::find(Blocked.begin(), Blocked.end(), U);
+  if (it == Blocked.end()) {
----------------
If you'd prefer, you can use range-based helpers from STLExtras.h. E.g 'find(Blocked, U)'.


Repository:
  rL LLVM

https://reviews.llvm.org/D49659





More information about the llvm-commits mailing list