Writing `for (StringRef &SourceFile : ...)` is strange to begin with.
Subsequently capturing "SourceFile" by reference is even stranger. Just
copy the StringRef, since that's cheap to do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275515
91177308-0d34-0410-b5e6-
96231b3b80d8
ThreadCount = std::thread::hardware_concurrency();
ThreadPool Pool(ThreadCount);
- for (StringRef &SourceFile : SourceFiles) {
- Pool.async([this, &SourceFile, &Coverage, &Printer, ShowFilenames] {
+ for (StringRef SourceFile : SourceFiles) {
+ Pool.async([this, SourceFile, &Coverage, &Printer, ShowFilenames] {
auto View = createSourceFileView(SourceFile, *Coverage);
if (!View) {
deferWarning("The file '" + SourceFile.str() + "' isn't covered.");