diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-01 04:19:43 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-01 04:19:43 +0000 |
commit | f94083333c1702006c068b55526441b2bce1d45b (patch) | |
tree | 9ac900b3de6e42840a14351047eeeac5ff3b8701 | |
parent | 8a0336a44bff2fcabc2de07cf482707c9508012f (diff) |
Give MachineFunctionAnalysis a destructor so it can verify that
that it released its allocated memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77775 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/CodeGen/MachineFunctionAnalysis.h | 2 | ||||
-rw-r--r-- | lib/CodeGen/MachineFunctionAnalysis.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineFunctionAnalysis.h b/include/llvm/CodeGen/MachineFunctionAnalysis.h index 5f1ff56af9..d020a7b4c7 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 8b7dba8121..ae9d5a99c0 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); |