aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/SourceCoverageView.h
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-23 18:57:32 +0000
committerVedant Kumar <vsk@apple.com>2016-09-23 18:57:32 +0000
commitbc6479850e1d4a4522c6d195f93704d3e78e54e3 (patch)
treea62afdc088765fcce12312bec7d6ff6d785b044a /llvm/tools/llvm-cov/SourceCoverageView.h
parent224ef8d73bb49c765ac8d7a352b244ec7c24807e (diff)
downloadllvm-bc6479850e1d4a4522c6d195f93704d3e78e54e3.zip
llvm-bc6479850e1d4a4522c6d195f93704d3e78e54e3.tar.gz
llvm-bc6479850e1d4a4522c6d195f93704d3e78e54e3.tar.bz2
[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. llvm-svn: 282281
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageView.h')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageView.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.h b/llvm/tools/llvm-cov/SourceCoverageView.h
index 129c590..2069fe5 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.h
+++ b/llvm/tools/llvm-cov/SourceCoverageView.h
@@ -142,7 +142,7 @@ public:
virtual void closeViewFile(OwnedStream OS) = 0;
/// \brief Create an index which lists reports for the given source files.
- virtual Error createIndexFile(ArrayRef<StringRef> SourceFiles,
+ virtual Error createIndexFile(ArrayRef<std::string> SourceFiles,
const coverage::CoverageMapping &Coverage) = 0;
/// @}