projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f681e2e
)
[llvm-cov] Clean up an awkward capture-by-reference (NFC)
author
Vedant Kumar
<vsk@apple.com>
Fri, 15 Jul 2016 01:19:35 +0000
(
01:19
+0000)
committer
Vedant Kumar
<vsk@apple.com>
Fri, 15 Jul 2016 01:19:35 +0000
(
01:19
+0000)
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
llvm/tools/llvm-cov/CodeCoverage.cpp
patch
|
blob
|
history
diff --git
a/llvm/tools/llvm-cov/CodeCoverage.cpp
b/llvm/tools/llvm-cov/CodeCoverage.cpp
index
eda074c
..
c2989f4
100644
(file)
--- 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.");