mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Stop leaking RegScavengers from TailDuplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158069 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c8f2fcc9a3
commit
d14e4e133f
@ -28,6 +28,7 @@
|
|||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include "llvm/ADT/DenseSet.h"
|
#include "llvm/ADT/DenseSet.h"
|
||||||
|
#include "llvm/ADT/OwningPtr.h"
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
#include "llvm/ADT/SetVector.h"
|
#include "llvm/ADT/SetVector.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
@ -62,7 +63,7 @@ namespace {
|
|||||||
const TargetRegisterInfo *TRI;
|
const TargetRegisterInfo *TRI;
|
||||||
MachineModuleInfo *MMI;
|
MachineModuleInfo *MMI;
|
||||||
MachineRegisterInfo *MRI;
|
MachineRegisterInfo *MRI;
|
||||||
RegScavenger *RS;
|
OwningPtr<RegScavenger> RS;
|
||||||
bool PreRegAlloc;
|
bool PreRegAlloc;
|
||||||
|
|
||||||
// SSAUpdateVRs - A list of virtual registers for which to update SSA form.
|
// SSAUpdateVRs - A list of virtual registers for which to update SSA form.
|
||||||
@ -132,9 +133,9 @@ bool TailDuplicatePass::runOnMachineFunction(MachineFunction &MF) {
|
|||||||
MRI = &MF.getRegInfo();
|
MRI = &MF.getRegInfo();
|
||||||
MMI = getAnalysisIfAvailable<MachineModuleInfo>();
|
MMI = getAnalysisIfAvailable<MachineModuleInfo>();
|
||||||
PreRegAlloc = MRI->isSSA();
|
PreRegAlloc = MRI->isSSA();
|
||||||
RS = NULL;
|
RS.reset();
|
||||||
if (MRI->tracksLiveness() && TRI->trackLivenessAfterRegAlloc(MF))
|
if (MRI->tracksLiveness() && TRI->trackLivenessAfterRegAlloc(MF))
|
||||||
RS = new RegScavenger();
|
RS.reset(new RegScavenger());
|
||||||
|
|
||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
while (TailDuplicateBlocks(MF))
|
while (TailDuplicateBlocks(MF))
|
||||||
|
Loading…
Reference in New Issue
Block a user