LLVM: lib/Support/BinaryStreamWriter.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

15

16using namespace llvm;

17

20

23

27

29 if (auto EC = Stream.writeBytes(Offset, Buffer))

30 return EC;

33}

34

36 uint8_t EncodedBytes[10] = {0};

39}

40

42 uint8_t EncodedBytes[10] = {0};

45}

46

49 return EC;

51 return EC;

52

54}

55

60

64

67

68

69

70

71

75 return EC;

77 return EC;

78 }

80}

81

82std::pair<BinaryStreamWriter, BinaryStreamWriter>

85

87

92 return {W1, W2};

93}

94

97 const uint64_t ZerosSize = 64;

98 static constexpr char Zeros[ZerosSize] = {};

99 while (Offset < NewOffset)

102 return E;

104}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

size_t size() const

size - Get the array size.

Provides read only access to a subclass of BinaryStream.

uint64_t bytesRemaining() const

LLVM_ABI Error readLongestContiguousChunk(ArrayRef< uint8_t > &Buffer)

Read as much as possible from the underlying string at the current offset without invoking a copy,...

BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.

LLVM_ABI Error writeCString(StringRef Str)

Write the string Str to the underlying stream followed by a null terminator.

Definition BinaryStreamWriter.cpp:47

Error writeArray(ArrayRef< T > Array)

Writes an array of objects of type T to the underlying stream, as if by using memcpy.

LLVM_ABI Error writeSLEB128(int64_t Value)

Write the unsigned integer Value to the underlying stream using ULEB128 encoding.

Definition BinaryStreamWriter.cpp:41

BinaryStreamWriter()=default

LLVM_ABI std::pair< BinaryStreamWriter, BinaryStreamWriter > split(uint64_t Off) const

Splits the Writer into two Writers at a given offset.

Definition BinaryStreamWriter.cpp:83

LLVM_ABI Error writeStreamRef(BinaryStreamRef Ref)

Efficiently reads all data from Ref, and writes it to this stream.

Definition BinaryStreamWriter.cpp:61

LLVM_ABI Error writeBytes(ArrayRef< uint8_t > Buffer)

Write the bytes specified in Buffer to the underlying stream.

Definition BinaryStreamWriter.cpp:28

uint64_t getLength() const

LLVM_ABI Error writeFixedString(StringRef Str)

Write the string Str to the underlying stream without a null terminator.

Definition BinaryStreamWriter.cpp:56

LLVM_ABI Error writeULEB128(uint64_t Value)

Write the unsigned integer Value to the underlying stream using ULEB128 encoding.

Definition BinaryStreamWriter.cpp:35

WritableBinaryStreamRef Stream

Error writeObject(const T &Obj)

Writes the object Obj to the underlying stream, as if by using memcpy.

LLVM_ABI Error padToAlignment(uint32_t Align)

Definition BinaryStreamWriter.cpp:95

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

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.

LLVM Value Representation.

A BinaryStream which can be read from as well as written to.

This is an optimization pass for GlobalISel generic memory operations.

ArrayRef< CharT > arrayRefFromStringRef(StringRef Input)

Construct a string ref from an array ref of unsigned chars.

@ Ref

The access may reference the value stored in memory.

@ First

Helpers to iterate all locations in the MemoryEffectsBase class.

FunctionAddr VTableAddr uintptr_t uintptr_t Data

uint64_t alignTo(uint64_t Size, Align A)

Returns a multiple of A needed to store Size bytes.

unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)

Utility function to encode a SLEB128 value to an output stream.

unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)

Utility function to encode a ULEB128 value to an output stream.

This struct is a compact representation of a valid (non-zero power of two) alignment.