From bc6479850e1d4a4522c6d195f93704d3e78e54e3 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Fri, 23 Sep 2016 18:57:32 +0000 Subject: [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 everywhere. llvm-svn: 282281 --- llvm/tools/llvm-cov/SourceCoverageView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/tools/llvm-cov/SourceCoverageView.h') 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 SourceFiles, + virtual Error createIndexFile(ArrayRef SourceFiles, const coverage::CoverageMapping &Coverage) = 0; /// @} -- cgit v1.1