Use a OwningPtr instead of a manual delete.

llvm-svn: 185673
This commit is contained in:
Rafael Espindola 2013-07-04 22:15:33 +00:00
parent 3947f5671a
commit 9a21854513
1 changed files with 3 additions and 5 deletions

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