llvm.org GIT mirror llvm / 9306564
Support: Functions for consuming endian specific data from a buffer. This adds a function to Endian.h that reads from and updates a pointer into a buffer with endian specific data. This is more convenient for stream-like reading of data than endian::read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204693 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 6 years ago
1 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
5353 (detail::PickAlignment::value)),
5454 sizeof(value_type));
5555 return byte_swap(ret);
56 }
57
58 /// Read a value of a particular endianness from a buffer, and increment the
59 /// buffer past that value.
60 template
61 inline value_type readNext(const unsigned char *&memory) {
62 value_type ret = read(memory);
63 memory += sizeof(value_type);
64 return ret;
5665 }
5766
5867 /// Write a value to memory with a particular endianness.