[llvm] r229797 - Introduce Target::createNullTargetStreamer and use it from IRObjectFile.

David Blaikie dblaikie at gmail.com
Thu Feb 19 11:14:49 PST 2015


On Thu, Feb 19, 2015 at 11:11 AM, Peter Collingbourne <peter at pcc.me.uk>
wrote:

> On Thu, Feb 19, 2015 at 11:01:18AM -0800, David Blaikie wrote:
> > > +    MCTargetStreamer *createNullTargetStreamer(MCStreamer &S) const {
> > >
> >
> > Could/should this (& NullTargetStreamerCtorFn) return by unique_ptr
> instead?
>
> The MCStreamer takes ownership of the target streamer on construction
> (see include/llvm/MC/MCStreamer.h line 176 and lib/MC/MCStreamer.cpp line
> 31), so probably not at the moment. It seems reasonable to make the client
> responsible for transferring ownership though.
>

Ah, curious.

Actually it seems I'd got this confused with other changes you'd made to
createNullStreamer (which I now see is distinct from this
createNull/Target/Streamer) - which seems to return ownership via raw
pointer. But maybe I recall trying to fix that & not being able to due to
some layering... I'm not sure.

- David


>
> Thanks,
> --
> Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150219/30165c22/attachment.html>


More information about the llvm-commits mailing list