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

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 16:08:30 PST 2018


vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Thanks, LGTM.



================
Comment at: tools/llvm-cov/CoverageReport.h:53
+                          FileCoverageSummary *FileReport,
+                          const CoverageFilter *Filters);
+
----------------
morehouse wrote:
> 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.
Right, ThreadPool will try to make a copy of data pointed-to by a captured reference, which won't compile for the move-only filters. Using pointers here sounds fine.


https://reviews.llvm.org/D41206





More information about the llvm-commits mailing list