[PATCH] Add function for consuming endian specific data from a buffer

Justin Bogner mail at justinbogner.com
Mon Mar 24 15:57:07 PDT 2014


Rafael EspĂ­ndola <rafael.espindola at gmail.com> writes:
> (const unsigned char *&memory)
>
> Can't this read out of a stream?

I'm not aware of any uses of input streams in LLVM. Generally, I expect
this to be used on MemoryBuffers, and some of the uses I updated in
clang read from StringRefs in this way.

> On 24 March 2014 17:28, Justin Bogner <mail at justinbogner.com> wrote:
>> 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.
>>
>> The second patch is just a mechanical update of clang to use this rather
>> than rolling their own. I've included it to show what it looks like to
>> use this new API.
>>




More information about the llvm-commits mailing list