[llvm-commits] [llvm] r98936 - /llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
Jeffrey Yasskin
jyasskin at google.com
Thu Mar 18 22:25:28 PDT 2010
Author: jyasskin
Date: Fri Mar 19 00:25:28 2010
New Revision: 98936
URL: http://llvm.org/viewvc/llvm-project?rev=98936&view=rev
Log:
Remove a memory leak from ThumbTargetMachine.
Modified:
llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.h?rev=98936&r1=98935&r2=98936&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.h Fri Mar 19 00:25:28 2010
@@ -23,6 +23,7 @@
#include "ARMISelLowering.h"
#include "Thumb1InstrInfo.h"
#include "Thumb2InstrInfo.h"
+#include "llvm/ADT/OwningPtr.h"
namespace llvm {
@@ -83,7 +84,8 @@
/// Thumb-1 and Thumb-2.
///
class ThumbTargetMachine : public ARMBaseTargetMachine {
- ARMBaseInstrInfo *InstrInfo; // either Thumb1InstrInfo or Thumb2InstrInfo
+ // Either Thumb1InstrInfo or Thumb2InstrInfo.
+ OwningPtr<ARMBaseInstrInfo> InstrInfo;
const TargetData DataLayout; // Calculates type size & alignment
ARMTargetLowering TLInfo;
public:
@@ -100,7 +102,9 @@
}
/// returns either Thumb1InstrInfo or Thumb2InstrInfo
- virtual const ARMBaseInstrInfo *getInstrInfo() const { return InstrInfo; }
+ virtual const ARMBaseInstrInfo *getInstrInfo() const {
+ return InstrInfo.get();
+ }
virtual const TargetData *getTargetData() const { return &DataLayout; }
};
More information about the llvm-commits
mailing list