LLVM: include/llvm/Object/Decompressor.h Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9#ifndef LLVM_OBJECT_DECOMPRESSOR_H

10#define LLVM_OBJECT_DECOMPRESSOR_H

11

17

18namespace llvm {

20

21

22class Decompressor {

23public:

24

25

26

27

28

30 bool IsLE, bool Is64Bit);

31

32

33

35 Out.resize(DecompressedSize);

36 return decompress({(uint8_t *)Out.data(), (size_t)DecompressedSize});

37 }

38

39

41

42

44

45private:

47

48 Error consumeCompressedHeader(bool Is64Bit, bool IsLittleEndian);

49

53};

54

55}

56}

57

58#endif

Lightweight error class with error context and mandatory checking.

Tagged union holding either a T or a Error.

MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...

StringRef - Represent a constant reference to a string, i.e.

Decompressor helps to handle decompression of compressed sections.

Definition Decompressor.h:22

Error resizeAndDecompress(T &Out)

Resize the buffer and uncompress section data into it.

Definition Decompressor.h:34

uint64_t getDecompressedSize()

Return memory buffer size required for decompression.

Definition Decompressor.h:43

LLVM_ABI Error decompress(MutableArrayRef< uint8_t > Output)

Uncompress section data to raw buffer provided.

static LLVM_ABI Expected< Decompressor > create(StringRef Name, StringRef Data, bool IsLE, bool Is64Bit)

Create decompressor object.

This is an optimization pass for GlobalISel generic memory operations.

FunctionAddr VTableAddr uintptr_t uintptr_t Data