forked from OSchip/llvm-project
Give MachineFunctionAnalysis a destructor so it can verify that
that it released its allocated memory. llvm-svn: 77775
This commit is contained in:
parent
859103d8e7
commit
c120612daa
|
@ -33,7 +33,7 @@ public:
|
|||
static char ID;
|
||||
explicit MachineFunctionAnalysis(TargetMachine &tm,
|
||||
CodeGenOpt::Level OL = CodeGenOpt::Default);
|
||||
|
||||
~MachineFunctionAnalysis();
|
||||
|
||||
MachineFunction &getMF() const { return *MF; }
|
||||
CodeGenOpt::Level getOptLevel() const { return OptLevel; }
|
||||
|
|
|
@ -29,6 +29,10 @@ MachineFunctionAnalysis::MachineFunctionAnalysis(TargetMachine &tm,
|
|||
FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) {
|
||||
}
|
||||
|
||||
MachineFunctionAnalysis::~MachineFunctionAnalysis() {
|
||||
assert(!MF && "MachineFunctionAnalysis left initialized!");
|
||||
}
|
||||
|
||||
bool MachineFunctionAnalysis::runOnFunction(Function &F) {
|
||||
assert(!MF && "MachineFunctionAnalysis already initialized!");
|
||||
MF = new MachineFunction(&F, TM);
|
||||
|
|
Loading…
Reference in New Issue