[PATCH] D41206: [llvm-cov] Multi-threaded implementation of prepareFileReports method.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 15:43:53 PST 2018


morehouse added a comment.

LGTM, but let Vedant comment since he's more familiar with this code.



================
Comment at: tools/llvm-cov/CoverageReport.h:53
+                          FileCoverageSummary *FileReport,
+                          const CoverageFilter *Filters);
+
----------------
Dor1s wrote:
> I don't like having raw pointers here, but I can't get it to work otherwise. The most recent issue I had: Filters were not applied, when I've been using const reference. Once I changed that to a pointer, it started to work. Is there any better pattern of using ThreadPool?
This is probably caused by pass-by-reference issues with the `std::bind` that occurs in the multi-parameter `ThreadPool::async`.  You could try using a lambda that captures the arguments to `prepareSingleFileReport` and then calls it with those arguments.  That should let you use the single-parameter `ThreadPool::async` and avoid the bind.

Otherwise, pointers work too.


https://reviews.llvm.org/D41206





More information about the llvm-commits mailing list