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
This commit is contained in:
Rafael Espindola 2013-07-04 22:15:33 +00:00
parent 25746ddd66
commit 8be527901a

View File

@ -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(); }
};
}