[LLVMdev] [RFC] Moving OnDiskHashTable from clang to LLVM

Justin Bogner
Mon, 24 Mar 2014 21:31:41 -0000

Rafael Espíndola <rafael.espindola at gmail.com>
writes:
> I think I see your point. The API seem sufficiently different that
> there might be use cases where one or the other is better. Using an
> explicit increment would make the code less readable. The API in
> Endian.h is nice for cases where we know the entire layout of large
> data section, since they are composable:
>
> struct dos_header {
>   support::ulittle16_t Magic;
>   support::ulittle16_t UsedBytesInTheLastPage;
> ...
> };
>
> If the use cases we have in clang or the ones you want to add don't
> match this, then regular stream api is probably better. I would keep
> it out of raw_ostream, at least for now. How a about a
> include/llvm/Support/EndianStream.h?

I've sent two patches to the list, one which introduces a stream writer
in EndianStream.h, and one that adds a readNext function to Endian.h:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140324/210057.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140324/210061.html

How do these sound?