Remove a memory leak from ThumbTargetMachine.

llvm-svn: 98936
This commit is contained in:
Jeffrey Yasskin 2010-03-19 05:25:28 +00:00
parent 5272e80ce5
commit 4822dfcc9a
1 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,7 @@
#include "ARMISelLowering.h"
#include "Thumb1InstrInfo.h"
#include "Thumb2InstrInfo.h"
#include "llvm/ADT/OwningPtr.h"
namespace llvm {
@ -83,7 +84,8 @@ public:
/// 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 @@ public:
}
/// 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; }
};