diff --git a/include/llvm/CodeGen/MachineFunctionAnalysis.h b/include/llvm/CodeGen/MachineFunctionAnalysis.h index 5f1ff56af94..d020a7b4c73 100644 --- a/include/llvm/CodeGen/MachineFunctionAnalysis.h +++ b/include/llvm/CodeGen/MachineFunctionAnalysis.h @@ -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; } diff --git a/lib/CodeGen/MachineFunctionAnalysis.cpp b/lib/CodeGen/MachineFunctionAnalysis.cpp index 8b7dba8121d..ae9d5a99c04 100644 --- a/lib/CodeGen/MachineFunctionAnalysis.cpp +++ b/lib/CodeGen/MachineFunctionAnalysis.cpp @@ -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);