LLVM
8.0.1
|
Decompressor helps to handle decompression of compressed sections. More...
#include "llvm/Object/Decompressor.h"
Public Member Functions | |
template<class T > | |
Error | resizeAndDecompress (T &Out) |
Resize the buffer and uncompress section data into it. More... | |
Error | decompress (MutableArrayRef< char > Buffer) |
Uncompress section data to raw buffer provided. More... | |
uint64_t | getDecompressedSize () |
Return memory buffer size required for decompression. More... | |
Static Public Member Functions | |
static Expected< Decompressor > | create (StringRef Name, StringRef Data, bool IsLE, bool Is64Bit) |
Create decompressor object. More... | |
static bool | isCompressed (const object::SectionRef &Section) |
Return true if section is compressed, including gnu-styled case. More... | |
static bool | isCompressedELFSection (uint64_t Flags, StringRef Name) |
Return true if section is a ELF compressed one. More... | |
static bool | isGnuStyle (StringRef Name) |
Return true if section name matches gnu style compressed one. More... | |
Decompressor helps to handle decompression of compressed sections.
Definition at line 21 of file Decompressor.h.
|
static |
Create decompressor object.
Name | Section name. |
Data | Section content. |
IsLE | Flag determines if Data is in little endian form. |
Is64Bit | Flag determines if object is 64 bit. |
Definition at line 21 of file Decompressor.cpp.
References llvm::object::createError(), D, and llvm::zlib::isAvailable().
Error Decompressor::decompress | ( | MutableArrayRef< char > | Buffer | ) |
Uncompress section data to raw buffer provided.
Buffer | Destination buffer. |
Definition at line 91 of file Decompressor.cpp.
References llvm::MutableArrayRef< T >::data(), Size, llvm::ArrayRef< T >::size(), and llvm::zlib::uncompress().
Referenced by resizeAndDecompress().
|
inline |
Return memory buffer size required for decompression.
Definition at line 43 of file Decompressor.h.
References isCompressed(), isCompressedELFSection(), isGnuStyle(), and llvm::ARMBuildAttrs::Section.
|
static |
Return true if section is compressed, including gnu-styled case.
Definition at line 80 of file Decompressor.cpp.
References llvm::object::SectionRef::getName(), llvm::object::SectionRef::isCompressed(), and Name.
Referenced by getDecompressedSize().
Return true if section is a ELF compressed one.
Definition at line 87 of file Decompressor.cpp.
References llvm::ELF::SHF_COMPRESSED.
Referenced by getDecompressedSize().
Return true if section name matches gnu style compressed one.
Definition at line 76 of file Decompressor.cpp.
References llvm::StringRef::startswith().
Referenced by getDecompressedSize().
Resize the buffer and uncompress section data into it.
Out | Destination buffer. |
Definition at line 33 of file Decompressor.h.
References decompress().