diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-08-03 22:16:16 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-08-03 22:16:16 +0000 |
commit | bc2160f7c90efffdd62587f1c978ba68b809ef35 (patch) | |
tree | 8c94391489651e0cf8e826cc5dd17d231cdd0964 | |
parent | 5cad12d12a823d258fc60e3975ffa142d0e190ef (diff) | |
download | external_llvm-bc2160f7c90efffdd62587f1c978ba68b809ef35.zip external_llvm-bc2160f7c90efffdd62587f1c978ba68b809ef35.tar.gz external_llvm-bc2160f7c90efffdd62587f1c978ba68b809ef35.tar.bz2 |
Stop leaking register infos in the disassemblers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187695 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Mips/Disassembler/MipsDisassembler.cpp | 4 | ||||
-rw-r--r-- | lib/Target/XCore/Disassembler/XCoreDisassembler.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp index bf640a7..ef01922 100644 --- a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp +++ b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp @@ -39,10 +39,10 @@ public: virtual ~MipsDisassemblerBase() {} - const MCRegisterInfo *getRegInfo() const { return RegInfo; } + const MCRegisterInfo *getRegInfo() const { return RegInfo.get(); } private: - const MCRegisterInfo *RegInfo; + OwningPtr<const MCRegisterInfo> RegInfo; protected: bool isBigEndian; }; diff --git a/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp b/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp index dcc0955..9c20abd 100644 --- a/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp +++ b/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp @@ -29,7 +29,7 @@ namespace { /// \brief A disassembler class for XCore. class XCoreDisassembler : public MCDisassembler { - const MCRegisterInfo *RegInfo; + OwningPtr<const MCRegisterInfo> RegInfo; public: XCoreDisassembler(const MCSubtargetInfo &STI, const MCRegisterInfo *Info) : MCDisassembler(STI), RegInfo(Info) {} @@ -42,7 +42,7 @@ public: raw_ostream &vStream, raw_ostream &cStream) const; - const MCRegisterInfo *getRegInfo() const { return RegInfo; } + const MCRegisterInfo *getRegInfo() const { return RegInfo.get(); } }; } |