diff options
author | George Rimar <grimar@accesssoftek.com> | 2017-05-18 08:00:01 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2017-05-18 08:00:01 +0000 |
commit | f98b9ac5daa2ceff3ce98123bee62cafa84e3144 (patch) | |
tree | 16cc5bd1bc20dbf52681e594c22f6568b48b4c74 /llvm/lib | |
parent | ba6b315ea92fec6bdf5092511c23f6681805cfd0 (diff) | |
download | bcm5719-llvm-f98b9ac5daa2ceff3ce98123bee62cafa84e3144.tar.gz bcm5719-llvm-f98b9ac5daa2ceff3ce98123bee62cafa84e3144.zip |
[lib/Object] - Minor API update for llvm::Decompressor.
I revisited Decompressor API (issue with it was triggered during D32865 review)
and found it is probably provides more then we really need.
Issue was about next method's signature:
Error decompress(SmallString<32> &Out);
It is too strict. At first I wanted to change it to decompress(SmallVectorImpl<char> &Out),
but then found it is still not flexible because sticks to SmallVector.
During reviews was suggested to use templating to simplify code. Patch do that.
Differential revision: https://reviews.llvm.org/D33200
llvm-svn: 303331
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Object/Decompressor.cpp | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index 61e75a2b56a..3dc1ec5789e 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -979,7 +979,7 @@ Error DWARFContextInMemory::maybeDecompress(const SectionRef &Sec, return Decompressor.takeError(); SmallString<32> Out; - if (auto Err = Decompressor->decompress(Out)) + if (auto Err = Decompressor->resizeAndDecompress(Out)) return Err; UncompressedSections.emplace_back(std::move(Out)); diff --git a/llvm/lib/Object/Decompressor.cpp b/llvm/lib/Object/Decompressor.cpp index 0be602b1fc1..89d199a3f3f 100644 --- a/llvm/lib/Object/Decompressor.cpp +++ b/llvm/lib/Object/Decompressor.cpp @@ -88,11 +88,6 @@ bool Decompressor::isCompressedELFSection(uint64_t Flags, StringRef Name) { return (Flags & ELF::SHF_COMPRESSED) || isGnuStyle(Name); } -Error Decompressor::decompress(SmallString<32> &Out) { - Out.resize(DecompressedSize); - return decompress({Out.data(), (size_t)DecompressedSize}); -} - Error Decompressor::decompress(MutableArrayRef<char> Buffer) { size_t Size = Buffer.size(); return zlib::uncompress(SectionData, Buffer.data(), Size); |