[llvm] r192303 - Flip the ownership of MCStreamer and MCTargetStreamer.
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Oct 9 10:35:18 PDT 2013
Thanks! No idea how I managed to get them swapped!
On Wednesday, October 9, 2013, Benjamin Kramer wrote:
> Author: d0k
> Date: Wed Oct 9 12:23:41 2013
> New Revision: 192303
>
> URL: http://llvm.org/viewvc/llvm-project?rev=192303&view=rev
> Log:
> Flip the ownership of MCStreamer and MCTargetStreamer.
>
> MCStreamer now owns the target streamer. This prevents leaking the target
> streamer.
>
> Modified:
> llvm/trunk/include/llvm/MC/MCStreamer.h
> llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
>
> Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=192303&r1=192302&r2=192303&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
> +++ llvm/trunk/include/llvm/MC/MCStreamer.h Wed Oct 9 12:23:41 2013
> @@ -66,11 +66,11 @@ typedef std::pair<const MCSection *, con
> /// be treated differently. Callers should always talk to a
> FooTargetStreamer.
> class MCTargetStreamer {
> protected:
> - OwningPtr<MCStreamer> Streamer;
> + MCStreamer *Streamer;
>
> public:
> virtual ~MCTargetStreamer();
> - void setStreamer(MCStreamer *S) { Streamer.reset(S); }
> + void setStreamer(MCStreamer *S) { Streamer = S; }
> };
>
> // FIXME: declared here because it is used from
> @@ -100,7 +100,7 @@ public:
> ///
> class MCStreamer {
> MCContext &Context;
> - MCTargetStreamer *TargetStreamer;
> + OwningPtr<MCTargetStreamer> TargetStreamer;
>
> MCStreamer(const MCStreamer &) LLVM_DELETED_FUNCTION;
> MCStreamer &operator=(const MCStreamer &) LLVM_DELETED_FUNCTION;
>
> Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=192303&r1=192302&r2=192303&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Wed Oct 9
> 12:23:41 2013
> @@ -305,7 +305,7 @@ private:
> } // end anonymous namespace
>
> ARMELFStreamer &ARMTargetELFStreamer::getStreamer() {
> - ARMELFStreamer *S = static_cast<ARMELFStreamer *>(Streamer.get());
> + ARMELFStreamer *S = static_cast<ARMELFStreamer *>(Streamer);
> return *S;
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu <javascript:;>
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131009/fd0bbcce/attachment.html>
More information about the llvm-commits
mailing list