diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-19 05:48:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-19 05:48:53 +0000 |
commit | 4c42a6de9f5456cc1b28f2d37db589f580f2adc7 (patch) | |
tree | dff0ce28acd1bb2e2143342eef18115ad0372472 /tools/llvm-mc/llvm-mc.cpp | |
parent | 1e50631675df50a0701ef8b527ced63d0d535a81 (diff) | |
download | external_llvm-4c42a6de9f5456cc1b28f2d37db589f580f2adc7.zip external_llvm-4c42a6de9f5456cc1b28f2d37db589f580f2adc7.tar.gz external_llvm-4c42a6de9f5456cc1b28f2d37db589f580f2adc7.tar.bz2 |
fix an MCInstPrinter leak that jyasskin pointed out:
createAsmStreamer now takes ownership of the instprinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 66e1260..3778bc9 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -278,18 +278,17 @@ static int AssembleInput(const char *ProgName) { return 1; } - OwningPtr<MCInstPrinter> IP; OwningPtr<MCCodeEmitter> CE; OwningPtr<MCStreamer> Str; OwningPtr<TargetAsmBackend> TAB; if (FileType == OFT_AssemblyFile) { - IP.reset(TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *Out)); + MCInstPrinter *IP = + TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *Out); if (ShowEncoding) CE.reset(TheTarget->createCodeEmitter(*TM, Ctx)); Str.reset(createAsmStreamer(Ctx, *Out,TM->getTargetData()->isLittleEndian(), - /*asmverbose*/true, IP.get(), CE.get(), - ShowInst)); + /*asmverbose*/true, IP, CE.get(), ShowInst)); } else { assert(FileType == OFT_ObjectFile && "Invalid file type!"); CE.reset(TheTarget->createCodeEmitter(*TM, Ctx)); |