diff options
author | Vedant Kumar <vsk@apple.com> | 2020-02-28 18:03:15 -0800 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-02-28 18:03:15 -0800 |
commit | 3388871714d3b718b823e76499b0c03877105e5d (patch) | |
tree | c4c6ce29637fa2564cd604a44247d149eff40330 /llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp | |
parent | 7300c338e5f5d1cb08caf7fa9e4b172b88d8e58e (diff) | |
download | llvm-3388871714d3b718b823e76499b0c03877105e5d.zip llvm-3388871714d3b718b823e76499b0c03877105e5d.tar.gz llvm-3388871714d3b718b823e76499b0c03877105e5d.tar.bz2 |
Revert "[Coverage] Revise format to reduce binary size"
This reverts commit 99317124e1c772e9a9de41a0cd56e1db049b4ea4. This is
still busted on Windows:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/40873
The llvm-cov tests report 'error: Could not load coverage information'.
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp')
-rw-r--r-- | llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp index 8d3c429..d75854a 100644 --- a/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp +++ b/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp @@ -11,11 +11,9 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ProfileData/InstrProf.h" #include "llvm/ProfileData/Coverage/CoverageMappingWriter.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/Support/Compression.h" #include "llvm/Support/LEB128.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> @@ -36,34 +34,12 @@ CoverageFilenamesSectionWriter::CoverageFilenamesSectionWriter( #endif } -void CoverageFilenamesSectionWriter::write(raw_ostream &OS, bool Compress) { - std::string FilenamesStr; - { - raw_string_ostream FilenamesOS{FilenamesStr}; - for (const auto &Filename : Filenames) { - encodeULEB128(Filename.size(), FilenamesOS); - FilenamesOS << Filename; - } - } - - SmallString<128> CompressedStr; - bool doCompression = - Compress && zlib::isAvailable() && DoInstrProfNameCompression; - if (doCompression) { - auto E = - zlib::compress(FilenamesStr, CompressedStr, zlib::BestSizeCompression); - if (E) - report_bad_alloc_error("Failed to zlib compress coverage data"); - } - - // ::= <num-filenames> - // <uncompressed-len> - // <compressed-len-or-zero> - // (<compressed-filenames> | <uncompressed-filenames>) +void CoverageFilenamesSectionWriter::write(raw_ostream &OS) { encodeULEB128(Filenames.size(), OS); - encodeULEB128(FilenamesStr.size(), OS); - encodeULEB128(doCompression ? CompressedStr.size() : 0U, OS); - OS << (doCompression ? StringRef(CompressedStr) : StringRef(FilenamesStr)); + for (const auto &Filename : Filenames) { + encodeULEB128(Filename.size(), OS); + OS << Filename; + } } namespace { |