Skip to content

Commit

Permalink
[mips] Fix a memory leak bug report by NAKAMURA Takumi.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170012 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ahatanak committed Dec 12, 2012
1 parent 8ba4880 commit de99993
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/Target/Mips/MipsTargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "MipsJITInfo.h"
#include "MipsSelectionDAGInfo.h"
#include "MipsSubtarget.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/DataLayout.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetMachine.h"
Expand All @@ -32,8 +33,8 @@ class MipsRegisterInfo;
class MipsTargetMachine : public LLVMTargetMachine {
MipsSubtarget Subtarget;
const DataLayout DL; // Calculates type size & alignment
const MipsInstrInfo *InstrInfo;
const MipsFrameLowering *FrameLowering;
OwningPtr<const MipsInstrInfo> InstrInfo;
OwningPtr<const MipsFrameLowering> FrameLowering;
MipsTargetLowering TLInfo;
MipsSelectionDAGInfo TSInfo;
MipsJITInfo JITInfo;
Expand All @@ -47,12 +48,12 @@ class MipsTargetMachine : public LLVMTargetMachine {
CodeGenOpt::Level OL,
bool isLittle);

virtual ~MipsTargetMachine() { delete InstrInfo; }
virtual ~MipsTargetMachine() {}

virtual const MipsInstrInfo *getInstrInfo() const
{ return InstrInfo; }
{ return InstrInfo.get(); }
virtual const TargetFrameLowering *getFrameLowering() const
{ return FrameLowering; }
{ return FrameLowering.get(); }
virtual const MipsSubtarget *getSubtargetImpl() const
{ return &Subtarget; }
virtual const DataLayout *getDataLayout() const
Expand Down

0 comments on commit de99993

Please sign in to comment.