diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-07-29 17:48:06 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-07-29 17:48:06 +0000 |
commit | 1abcd06856df324eac98d4bf5ba673fb77ae6a11 (patch) | |
tree | e4f96369b02bdba4be3ac49bbdf9fe22d44fe7bb /tools/llvm-mc/llvm-mc.cpp | |
parent | c46a5f20c5ab9c497a91d3227d6368e92069cace (diff) | |
download | external_llvm-1abcd06856df324eac98d4bf5ba673fb77ae6a11.zip external_llvm-1abcd06856df324eac98d4bf5ba673fb77ae6a11.tar.gz external_llvm-1abcd06856df324eac98d4bf5ba673fb77ae6a11.tar.bz2 |
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
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index f01b4d9..33531f1 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -287,25 +287,24 @@ static int AssembleInput(const char *ProgName) { return 1; } - OwningPtr<MCCodeEmitter> CE; OwningPtr<MCStreamer> Str; - OwningPtr<TargetAsmBackend> TAB; if (FileType == OFT_AssemblyFile) { MCInstPrinter *IP = TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI); + MCCodeEmitter *CE = 0; if (ShowEncoding) - CE.reset(TheTarget->createCodeEmitter(*TM, Ctx)); + CE = TheTarget->createCodeEmitter(*TM, Ctx); Str.reset(createAsmStreamer(Ctx, *Out,TM->getTargetData()->isLittleEndian(), - /*asmverbose*/true, IP, CE.get(), ShowInst)); + /*asmverbose*/true, IP, CE, ShowInst)); } else if (FileType == OFT_Null) { Str.reset(createNullStreamer(Ctx)); } else { assert(FileType == OFT_ObjectFile && "Invalid file type!"); - CE.reset(TheTarget->createCodeEmitter(*TM, Ctx)); - TAB.reset(TheTarget->createAsmBackend(TripleName)); + MCCodeEmitter *CE = TheTarget->createCodeEmitter(*TM, Ctx); + TargetAsmBackend *TAB = TheTarget->createAsmBackend(TripleName); Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *TAB, - *Out, CE.get(), RelaxAll)); + *Out, CE, RelaxAll)); } if (EnableLogging) { |