[PATCH] D136702: [llvm-cov] Look up object files using debuginfod

Daniel Thornburgh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 12:26:49 PST 2023


mysterymath added inline comments.


================
Comment at: llvm/lib/ProfileData/Coverage/CoverageMapping.cpp:421
+    llvm::sort(ProfileBinaryIDs, Compare);
+    std::unique(ProfileBinaryIDs.begin(), ProfileBinaryIDs.end(), Compare);
+
----------------
jgorbe wrote:
> We're getting build errors here (and the similar call to `std::unique` on line 426) with `-Wunused-result`.
> 
> This looks like a bug: `std::unique` returns the new end of the range, and typically you need to call `container.erase(new_end, container.end())` after the call to `std::unique` to reduce the container size to match the new logical size. See https://en.cppreference.com/w/cpp/algorithm/unique.
Thanks; did a quick fix forward for this. This uncovered a mistake with Compare as well; std::unique requires a == comparator, while sort and set_difference a < comparator.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136702



More information about the llvm-commits mailing list