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

Derek Schuff dschuff at google.com
Fri Jan 20 11:55:56 PST 2012


And finally, the StreamingMemoryObject implementation, modified
BitcodeReader, and modifed llvm-dis.cpp using the streaming interface.
Please take a look

thanks,
-Derek

On Wed, Jan 18, 2012 at 4:05 PM, Derek Schuff <dschuff at google.com> wrote:

> 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/20120120/c9c791cd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BitcodeReader_streaming.diff
Type: text/x-patch
Size: 33602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120120/c9c791cd/attachment.bin>


More information about the llvm-commits mailing list