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 /lib | |
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 'lib')
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 7f39471..2025463 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -16,6 +16,7 @@ #include "llvm/MC/MCInstPrinter.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCSymbol.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/ErrorHandling.h" @@ -29,7 +30,7 @@ namespace { class MCAsmStreamer : public MCStreamer { formatted_raw_ostream &OS; const MCAsmInfo &MAI; - MCInstPrinter *InstPrinter; + OwningPtr<MCInstPrinter> InstPrinter; MCCodeEmitter *Emitter; SmallString<128> CommentToEmit; |