diff options
author | Vedant Kumar <vsk@apple.com> | 2016-07-15 01:19:35 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-07-15 01:19:35 +0000 |
commit | 84c452dea35be1515da81a2bec11a178bd001c8d (patch) | |
tree | cd1c85a8b4abf4a036b46fbb72d1455eaf8d23cc /llvm/tools/llvm-cov/CodeCoverage.cpp | |
parent | f681e2e50647ed74992ea8476606e49d87b412c6 (diff) | |
download | bcm5719-llvm-84c452dea35be1515da81a2bec11a178bd001c8d.tar.gz bcm5719-llvm-84c452dea35be1515da81a2bec11a178bd001c8d.zip |
[llvm-cov] Clean up an awkward capture-by-reference (NFC)
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.
llvm-svn: 275515
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/CodeCoverage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index eda074cc44e..c2989f43963 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -551,8 +551,8 @@ int CodeCoverageTool::show(int argc, const char **argv, 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."); |