[llvm] r185673 - Use a OwningPtr instead of a manual delete.

Rafael Espindola rafael.espindola at gmail.com
Thu Jul 4 15:15:34 PDT 2013


Author: rafael
Date: Thu Jul  4 17:15:33 2013
New Revision: 185673

URL: http://llvm.org/viewvc/llvm-project?rev=185673&view=rev
Log:
Use a OwningPtr instead of a manual delete.

Modified:
    llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp

Modified: llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp?rev=185673&r1=185672&r2=185673&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp Thu Jul  4 17:15:33 2013
@@ -38,7 +38,7 @@ typedef MCDisassembler::DecodeStatus Dec
 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(); }
 };
 
 }





More information about the llvm-commits mailing list