forked from OSchip/llvm-project
Fix a leak on the r600 backend.
This should bring the valgrind bot back to life. llvm-svn: 182561
This commit is contained in:
parent
bd6847fbea
commit
39aca620db
|
@ -64,11 +64,11 @@ AMDGPUTargetMachine::AMDGPUTargetMachine(const Target &T, StringRef TT,
|
|||
InstrItins(&Subtarget.getInstrItineraryData()) {
|
||||
// TLInfo uses InstrInfo so it must be initialized after.
|
||||
if (Subtarget.device()->getGeneration() <= AMDGPUDeviceInfo::HD6XXX) {
|
||||
InstrInfo = new R600InstrInfo(*this);
|
||||
TLInfo = new R600TargetLowering(*this);
|
||||
InstrInfo.reset(new R600InstrInfo(*this));
|
||||
TLInfo.reset(new R600TargetLowering(*this));
|
||||
} else {
|
||||
InstrInfo = new SIInstrInfo(*this);
|
||||
TLInfo = new SITargetLowering(*this);
|
||||
InstrInfo.reset(new SIInstrInfo(*this));
|
||||
TLInfo.reset(new SITargetLowering(*this));
|
||||
}
|
||||
initAsmInfo();
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ class AMDGPUTargetMachine : public LLVMTargetMachine {
|
|||
const DataLayout Layout;
|
||||
AMDGPUFrameLowering FrameLowering;
|
||||
AMDGPUIntrinsicInfo IntrinsicInfo;
|
||||
const AMDGPUInstrInfo *InstrInfo;
|
||||
AMDGPUTargetLowering *TLInfo;
|
||||
OwningPtr<AMDGPUInstrInfo> InstrInfo;
|
||||
OwningPtr<AMDGPUTargetLowering> TLInfo;
|
||||
const InstrItineraryData *InstrItins;
|
||||
|
||||
public:
|
||||
|
@ -48,12 +48,16 @@ public:
|
|||
virtual const AMDGPUIntrinsicInfo *getIntrinsicInfo() const {
|
||||
return &IntrinsicInfo;
|
||||
}
|
||||
virtual const AMDGPUInstrInfo *getInstrInfo() const { return InstrInfo; }
|
||||
virtual const AMDGPUInstrInfo *getInstrInfo() const {
|
||||
return InstrInfo.get();
|
||||
}
|
||||
virtual const AMDGPUSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
||||
virtual const AMDGPURegisterInfo *getRegisterInfo() const {
|
||||
return &InstrInfo->getRegisterInfo();
|
||||
}
|
||||
virtual AMDGPUTargetLowering *getTargetLowering() const { return TLInfo; }
|
||||
virtual AMDGPUTargetLowering *getTargetLowering() const {
|
||||
return TLInfo.get();
|
||||
}
|
||||
virtual const InstrItineraryData *getInstrItineraryData() const {
|
||||
return InstrItins;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue