File indexing completed on 2026-05-10 08:44:17
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_OBJECT_DECOMPRESSOR_H
0010 #define LLVM_OBJECT_DECOMPRESSOR_H
0011
0012 #include "llvm/ADT/ArrayRef.h"
0013 #include "llvm/ADT/StringRef.h"
0014 #include "llvm/Support/Compression.h"
0015 #include "llvm/Support/Error.h"
0016
0017 namespace llvm {
0018 namespace object {
0019
0020
0021 class Decompressor {
0022 public:
0023
0024
0025
0026
0027
0028 static Expected<Decompressor> create(StringRef Name, StringRef Data,
0029 bool IsLE, bool Is64Bit);
0030
0031
0032
0033 template <class T> Error resizeAndDecompress(T &Out) {
0034 Out.resize(DecompressedSize);
0035 return decompress({(uint8_t *)Out.data(), (size_t)DecompressedSize});
0036 }
0037
0038
0039 Error decompress(MutableArrayRef<uint8_t> Output);
0040
0041
0042 uint64_t getDecompressedSize() { return DecompressedSize; }
0043
0044 private:
0045 Decompressor(StringRef Data);
0046
0047 Error consumeCompressedHeader(bool Is64Bit, bool IsLittleEndian);
0048
0049 StringRef SectionData;
0050 uint64_t DecompressedSize;
0051 DebugCompressionType CompressionType = DebugCompressionType::None;
0052 };
0053
0054 }
0055 }
0056
0057 #endif