[llvm-commits] Proposal/patch: Enable bitcode streaming

Derek Schuff dschuff at google.com
Wed Jan 18 16:05:35 PST 2012


Hi Chris & Nick,
Attached is a very slightly updated version of patch number 1, and patch
number 2, with a new StreamableMemoryObject (derived from MemoryObject),
suitable for streaming usage.
One consequence of deriving from MemoryObject is that I had to make the
getExtent and readByte/readBytes methods of MemoryObject no longer const,
since they are definitely not const in the StreamableMemoryObject. This
resulted in having to remove const in several usages of MemoryObject. It
seemed less bad than adding a bunch of mutable data members in
StreamableMemoryObject or creating a near-duplicate of MemoryObject.

The third patch is nearly ready as well, please let me know what you think.
thanks,
-Derek

On Thu, Jan 12, 2012 at 3:09 PM, Derek Schuff <dschuff at google.com> wrote:

>
>> Overall, my recommendation would be to split this into three patches: the
>> first patch would just increase the abstraction level of the bitcode
>> reader, by adding various predicates that you need and tidy things up.  The
>> second would extend MemoryObject as needed to add the functionality that
>> you need.  The third would actually switch the meat of the bitcode reader
>> to be lazy-streaming, and switch a tool to use it.
>>
>>
>
> Attached is patch 1 as listed above: a refactor of BistreamCursor to use
> an offset rather than raw pointers, and abstract the relevant operations
> into functions. For now BitstreamReader is the same. I've tested it locally
> and it works in isolation and is hopefully ready to apply. Patch 2, a
> subclass of MemoryObject (StreamableMemoryObject) to replace the
> BitstreamBytes class here, is upcoming next.
>
> thanks,
> -Derek
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120118/45b3638a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BitstreamCursor_refactor2.diff
Type: text/x-patch
Size: 5373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120118/45b3638a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StreamableMemoryObject.diff
Type: text/x-patch
Size: 24089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120118/45b3638a/attachment-0001.bin>


More information about the llvm-commits mailing list