[PATCH] D97353: [Coverage][Unittest] Fix stringref issue
Jinsong Ji via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 06:26:10 PST 2021
jsji updated this revision to Diff 326073.
jsji added a comment.
Update comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97353/new/
https://reviews.llvm.org/D97353
Files:
llvm/unittests/ProfileData/CoverageMappingTest.cpp
Index: llvm/unittests/ProfileData/CoverageMappingTest.cpp
===================================================================
--- llvm/unittests/ProfileData/CoverageMappingTest.cpp
+++ llvm/unittests/ProfileData/CoverageMappingTest.cpp
@@ -201,6 +201,9 @@
void readCoverageRegions(const std::string &Coverage,
OutputFunctionCoverageData &Data) {
+ // We will re-use the StringRef in duplicate tests, clear it to avoid
+ // clobber previous ones.
+ Filenames.clear();
Filenames.resize(Files.size() + 1);
for (const auto &E : Files)
Filenames[E.getValue()] = E.getKey().str();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97353.326073.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210224/d28f03fc/attachment.bin>
More information about the llvm-commits
mailing list