summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/Coverage
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-09-16 19:08:41 +0000
committerVedant Kumar <vsk@apple.com>2019-09-16 19:08:41 +0000
commit95de24978e80c1fac6d452057b21a448a0c6d7d6 (patch)
tree571e05cff7c1db2cf76be51d5cdd205a30f7fe60 /llvm/lib/ProfileData/Coverage
parentdd63b9f570da6b557d41b05eb22213d070c2d110 (diff)
downloadbcm5719-llvm-95de24978e80c1fac6d452057b21a448a0c6d7d6.tar.gz
bcm5719-llvm-95de24978e80c1fac6d452057b21a448a0c6d7d6.zip
[Coverage] Assert that filenames in a TU are unique, NFC
llvm-svn: 372024
Diffstat (limited to 'llvm/lib/ProfileData/Coverage')
-rw-r--r--llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
index 432b20f217c..d75854a60d1 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
@@ -24,6 +24,16 @@
using namespace llvm;
using namespace coverage;
+CoverageFilenamesSectionWriter::CoverageFilenamesSectionWriter(
+ ArrayRef<StringRef> Filenames)
+ : Filenames(Filenames) {
+#ifndef NDEBUG
+ StringSet<> NameSet;
+ for (StringRef Name : Filenames)
+ assert(NameSet.insert(Name).second && "Duplicate filename");
+#endif
+}
+
void CoverageFilenamesSectionWriter::write(raw_ostream &OS) {
encodeULEB128(Filenames.size(), OS);
for (const auto &Filename : Filenames) {
OpenPOWER on IntegriCloud