From 1abcd06856df324eac98d4bf5ba673fb77ae6a11 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 29 Jul 2010 17:48:06 +0000 Subject: Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCStreamer.h | 6 +++++- include/llvm/Target/TargetRegistry.h | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index aca7dd3..1ded9f7 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -331,7 +331,7 @@ namespace llvm { /// InstPrint. /// /// \param CE - If given, a code emitter to use to show the instruction - /// encoding inline with the assembly. + /// encoding inline with the assembly. This method takes ownership of \arg CE. /// /// \param ShowInst - Whether to show the MCInst representation inline with /// the assembly. @@ -343,12 +343,16 @@ namespace llvm { /// createMachOStreamer - Create a machine code streamer which will generate /// Mach-O format object files. + /// + /// Takes ownership of \arg TAB and \arg CE. MCStreamer *createMachOStreamer(MCContext &Ctx, TargetAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *CE, bool RelaxAll = false); /// createWinCOFFStreamer - Create a machine code streamer which will /// generate Microsoft COFF format object files. + /// + /// Takes ownership of \arg TAB and \arg CE. MCStreamer *createWinCOFFStreamer(MCContext &Ctx, TargetAsmBackend &TAB, MCCodeEmitter &CE, raw_ostream &OS); diff --git a/include/llvm/Target/TargetRegistry.h b/include/llvm/Target/TargetRegistry.h index f022149..2817b0c 100644 --- a/include/llvm/Target/TargetRegistry.h +++ b/include/llvm/Target/TargetRegistry.h @@ -278,9 +278,9 @@ namespace llvm { /// /// \arg TT - The target triple. /// \arg Ctx - The target context. - /// \arg TAB - The target assembler backend object. + /// \arg TAB - The target assembler backend object. Takes ownership. /// \arg _OS - The stream object. - /// \arg _Emitter - The target independent assembler object. + /// \arg _Emitter - The target independent assembler object.Takes ownership. /// \arg RelaxAll - Relax all fixups? MCStreamer *createObjectStreamer(const std::string &TT, MCContext &Ctx, TargetAsmBackend &TAB, -- cgit v1.1