search for: ulittle16_t

Displaying 4 results from an estimated 4 matches for "ulittle16_t".

2014 Mar 24
2
[LLVMdev] [RFC] Moving OnDiskHashTable from clang to LLVM
...anging the existing clients to use Endian.h is a bit of work, as the read functions in clang::io actually move a cursor over the read data, so simply switching would actually be something like this: - unsigned len = ReadUnalignedLE16(Items); + unsigned len = *reinterpret_cast<llvm::support::ulittle16_t *>(Items); + Items += 2; Presumably, hiding the addition helps maintainability. I suppose we could add functions functions that increment the buffer to Endian.h, and maybe expose an API like so: + unsigned len = support::readFromBuffer<support::ulittle16_t>(Items) For writing, what...
2017 Feb 19
5
RFC: Adding llvm::ThinStream
...t you can easily pass streams around without worrying about reference lifetime issues. To re-iterate: *When using a ThinStreamReader, copies are the exception, not the rule and for most implementations of ThinStream will never occur.* Suppose you have a struct: struct Header { char Magic[48]; ulittle16_t A; ulittle16_t B; ulittle64_t C; }; To read this using a `ThinStreamReader`, you would write this: ThinStreamReader Reader(Stream); const Header *H; if (auto EC = Reader.readObject(H)) return EC; and `ThinStreamReader` just reinterpret_casts the underlying bytes to your structure. The sam...
2017 Feb 22
2
RFC: Adding llvm::ThinStream
...ithout worrying about reference lifetime issues. > > To re-iterate: *When using a ThinStreamReader, copies are the exception, > not the rule and for most implementations of ThinStream will never occur.* > Suppose you have a struct: > > struct Header { > char Magic[48]; > ulittle16_t A; > ulittle16_t B; > ulittle64_t C; > }; > > To read this using a `ThinStreamReader`, you would write this: > > ThinStreamReader Reader(Stream); > const Header *H; > if (auto EC = Reader.readObject(H)) > return EC; > > and `ThinStreamReader` just reinterpr...
2014 Mar 22
3
[LLVMdev] [RFC] Moving OnDiskHashTable from clang to LLVM
Rafael Avila de Espindola <rafael.espindola at gmail.com> writes: >> On Mar 22, 2014, at 1:31, Justin Bogner <mail at justinbogner.com> wrote: >> Also, the header includes a "clang::io" namespace with some operations >> for reading and writing little endian files. Should these be directly >> renamed to "llvm::io", or would something like