[PATCH] Modify OwningBinary interface to separate inspection from ownership transfer.

Alexey Samsonov vonosmas at gmail.com
Thu Oct 30 17:00:56 PDT 2014


SGTM

On Thu, Oct 30, 2014 at 4:00 PM, Lang Hames <lhames at gmail.com> wrote:

> Hi Guys,
>
> The following patch modifies the OwningBuffer class to separate inspection
> and ownership transfer.
>
> The getBinary and getBuffer method now return ordinary pointers (with
> appropriate const-ness). To transfer ownership, you now call takeBinary(),
> which returns a pair of the Binary and a MemoryBuffer. This interface is
> odd, but an improvement over transferring the two things separately - this
> way it is impossible to forget to transfer one of the pair.
>
> In a future patch I'll look at moving clients of these methods to just
> holding OwningBinary - that's probably what they want anyway.
>
> Does this look reasonable?
>
> Cheers,
> Lang.
>
>


-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141030/0d8581a5/attachment.html>


More information about the llvm-commits mailing list