OSDN Git Service

[llvm-cov] Get rid of all invalid filename references
authorVedant Kumar <vsk@apple.com>
Fri, 23 Sep 2016 18:57:32 +0000 (18:57 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 23 Sep 2016 18:57:32 +0000 (18:57 +0000)
commitfd066351a5eb34b4cd04741be998094ffad95ce9
treec7fdf76071b91dd670e24ec5090decb4801e9322
parentc36f315edc0e8713a0294e56bc34f9e02431d394
[llvm-cov] Get rid of all invalid filename references

We used to append filenames into a vector of std::string, and then
append a reference to each string into a separate vector. This made it
easier to work with the getUniqueSourceFiles API. But it's buggy.

std::string has a small-string optimization, so you can't expect to
capture a reference to one if you're copying it into a growing vector.
Add a test that triggers this invalid reference to std::string scenario,
and kill the issue with fire by just using ArrayRef<std::string>
everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282281 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-cov/scan-directory.test
tools/llvm-cov/CodeCoverage.cpp
tools/llvm-cov/CoverageExporterJson.cpp
tools/llvm-cov/CoverageReport.cpp
tools/llvm-cov/CoverageReport.h
tools/llvm-cov/SourceCoverageView.h
tools/llvm-cov/SourceCoverageViewHTML.cpp
tools/llvm-cov/SourceCoverageViewHTML.h
tools/llvm-cov/SourceCoverageViewText.cpp
tools/llvm-cov/SourceCoverageViewText.h