15 #ifndef LLVM_SUPPORT_LEB128_H
16 #define LLVM_SUPPORT_LEB128_H
26 uint8_t Byte = Value & 0x7f;
29 More = !((((Value == 0 ) && ((Byte & 0x40) == 0)) ||
30 ((Value == -1) && ((Byte & 0x40) != 0))));
39 unsigned Padding = 0) {
41 uint8_t Byte = Value & 0x7f;
43 if (Value != 0 || Padding != 0)
50 for (; Padding != 1; --Padding)
59 unsigned Padding = 0) {
62 uint8_t Byte = Value & 0x7f;
64 if (Value != 0 || Padding != 0)
71 for (; Padding != 1; --Padding)
75 return (
unsigned)(p - orig_p);
81 const uint8_t *orig_p = p;
85 Value += (*p & 0x7f) << Shift;
87 }
while (*p++ >= 128);
95 #endif // LLVM_SYSTEM_LEB128_H
uint64_t decodeULEB128(const uint8_t *p, unsigned *n=0)
Utility function to decode a ULEB128 value.
void encodeSLEB128(int64_t Value, raw_ostream &OS)
Utility function to encode a SLEB128 value to an output stream.
LLVM Value Representation.
void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding=0)
Utility function to encode a ULEB128 value to an output stream.