llvm::decodeSLEB128

Utility function to decode a SLEB128 value.

Synopsis

Declared in <llvm/Support/LEB128.h>

int64_t
decodeSLEB128(
    uint8_t const* p,
    unsigned int* n = nullptr,
    uint8_t const* end = nullptr,
    char const** error = nullptr);

Description

If error is non-null, it will point to a static error message, if an error occurred. It will not be modified on success.

Return Value

The decoded signed value, or 0 on error.

Parameters

NameDescription
pPointer to the SLEB128-encoded bytes.
nIf non-null, set to the number of bytes consumed.
endOptional end of buffer; decoding stops with an error if reached.
errorIf non-null, receives a static error message on failure.