diff options
author | Vedant Kumar <vsk@apple.com> | 2017-09-08 18:44:49 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-09-08 18:44:49 +0000 |
commit | 72c3a11488c411ddb7027e2cecaf7c2467b213c8 (patch) | |
tree | 572bf9198ed5e1a186374a38ee75543389529bfd /llvm/tools/llvm-cov/CoverageSummaryInfo.h | |
parent | efcf41b528232d81dd62dc3a1585532c75549ccc (diff) | |
download | llvm-72c3a11488c411ddb7027e2cecaf7c2467b213c8.zip llvm-72c3a11488c411ddb7027e2cecaf7c2467b213c8.tar.gz llvm-72c3a11488c411ddb7027e2cecaf7c2467b213c8.tar.bz2 |
[llvm-cov] Fix a lifetime issue
This fixes an issue where a std::string was moved to a constructor
which accepted a StringRef.
llvm-svn: 312816
Diffstat (limited to 'llvm/tools/llvm-cov/CoverageSummaryInfo.h')
-rw-r--r-- | llvm/tools/llvm-cov/CoverageSummaryInfo.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/llvm-cov/CoverageSummaryInfo.h b/llvm/tools/llvm-cov/CoverageSummaryInfo.h index 1603731..e9e3f47 100644 --- a/llvm/tools/llvm-cov/CoverageSummaryInfo.h +++ b/llvm/tools/llvm-cov/CoverageSummaryInfo.h @@ -120,14 +120,14 @@ struct FunctionCoverageSummary { RegionCoverageInfo RegionCoverage; LineCoverageInfo LineCoverage; - FunctionCoverageSummary(StringRef Name) : Name(Name), ExecutionCount(0) {} + FunctionCoverageSummary(const std::string &Name) + : Name(Name), ExecutionCount(0) {} - FunctionCoverageSummary(StringRef Name, uint64_t ExecutionCount, + FunctionCoverageSummary(const std::string &Name, uint64_t ExecutionCount, const RegionCoverageInfo &RegionCoverage, const LineCoverageInfo &LineCoverage) : Name(Name), ExecutionCount(ExecutionCount), - RegionCoverage(RegionCoverage), LineCoverage(LineCoverage) { - } + RegionCoverage(RegionCoverage), LineCoverage(LineCoverage) {} /// \brief Compute the code coverage summary for the given function coverage /// mapping record. |