diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-04 22:15:33 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-04 22:15:33 +0000 |
commit | 8be527901ac87d49f7b0b56c96dbc6dadabb5069 (patch) | |
tree | f06aaefdad870c838f9268dcf28418b654687c0c /lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp | |
parent | 25746ddd66651bdad159444d0331b7df4dc22842 (diff) | |
download | external_llvm-8be527901ac87d49f7b0b56c96dbc6dadabb5069.zip external_llvm-8be527901ac87d49f7b0b56c96dbc6dadabb5069.tar.gz external_llvm-8be527901ac87d49f7b0b56c96dbc6dadabb5069.tar.bz2 |
Use a OwningPtr instead of a manual delete.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp')
-rw-r--r-- | lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp b/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp index af0e23d..36dd704 100644 --- a/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp +++ b/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp @@ -38,7 +38,7 @@ typedef MCDisassembler::DecodeStatus DecodeStatus; namespace { /// AArch64 disassembler for all AArch64 platforms. class AArch64Disassembler : public MCDisassembler { - const MCRegisterInfo *RegInfo; + OwningPtr<const MCRegisterInfo> RegInfo; public: /// Initializes the disassembler. /// @@ -46,9 +46,7 @@ public: : MCDisassembler(STI), RegInfo(Info) { } - ~AArch64Disassembler() { - delete RegInfo; - } + ~AArch64Disassembler() {} /// See MCDisassembler. DecodeStatus getInstruction(MCInst &instr, @@ -58,7 +56,7 @@ public: raw_ostream &vStream, raw_ostream &cStream) const; - const MCRegisterInfo *getRegInfo() const { return RegInfo; } + const MCRegisterInfo *getRegInfo() const { return RegInfo.get(); } }; } |