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

Jorge Gorbe Moya via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 10:29:12 PST 2023


jgorbe added inline comments.


================
Comment at: llvm/lib/ProfileData/Coverage/CoverageMapping.cpp:421
+    llvm::sort(ProfileBinaryIDs, Compare);
+    std::unique(ProfileBinaryIDs.begin(), ProfileBinaryIDs.end(), Compare);
+
----------------
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.


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