diff options
| author | John Criswell <criswell@uiuc.edu> | 2003-08-28 21:43:17 +0000 |
|---|---|---|
| committer | John Criswell <criswell@uiuc.edu> | 2003-08-28 21:43:17 +0000 |
| commit | a4b09fe0710d1102d3e00db4aa7e108f327955ec (patch) | |
| tree | 3746f8eb9b093cbcd9dbcfc4ebc6e3fd0aae8204 /llvm/lib/CodeGen/InstrSched | |
| parent | a289abfc82f23034d237c5d8ac9977453057b839 (diff) | |
| download | bcm5719-llvm-a4b09fe0710d1102d3e00db4aa7e108f327955ec.tar.gz bcm5719-llvm-a4b09fe0710d1102d3e00db4aa7e108f327955ec.zip | |
Fixed two double free bugs that caused llc to segfault or run forever.
llvm-svn: 8191
Diffstat (limited to 'llvm/lib/CodeGen/InstrSched')
| -rw-r--r-- | llvm/lib/CodeGen/InstrSched/SchedGraph.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/InstrSched/SchedGraph.cpp b/llvm/lib/CodeGen/InstrSched/SchedGraph.cpp index 9de04343648..bcdd1cfcfce 100644 --- a/llvm/lib/CodeGen/InstrSched/SchedGraph.cpp +++ b/llvm/lib/CodeGen/InstrSched/SchedGraph.cpp @@ -53,10 +53,18 @@ SchedGraphNode::SchedGraphNode(unsigned NID, MachineBasicBlock *mbb, } } +// +// Method: SchedGraphNode Destructor +// +// Description: +// Free memory allocated by the SchedGraphNode object. +// +// Notes: +// Do not delete the edges here. The base class will take care of that. +// Only handle subclass specific stuff here (where currently there is +// none). +// SchedGraphNode::~SchedGraphNode() { - // for each node, delete its out-edges - std::for_each(beginOutEdges(), endOutEdges(), - deleter<SchedGraphEdge>); } // @@ -67,11 +75,19 @@ SchedGraph::SchedGraph(MachineBasicBlock &mbb, const TargetMachine& target) buildGraph(target); } +// +// Method: SchedGraph Destructor +// +// Description: +// This method deletes memory allocated by the SchedGraph object. +// +// Notes: +// Do not delete the graphRoot or graphLeaf here. The base class handles +// that bit of work. +// SchedGraph::~SchedGraph() { for (const_iterator I = begin(); I != end(); ++I) delete I->second; - delete graphRoot; - delete graphLeaf; } void SchedGraph::dump() const { |

