summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-20 00:56:17 +0000
committerDan Gohman <gohman@apple.com>2008-08-20 00:56:17 +0000
commit98265cae870fa2def132fcd344fe446209f2e7f1 (patch)
tree38011dbc991919a7dadd62bb89bc96309785bd3a /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parenteaef5f612a7b25439f6d23be5684b1d7017d35ed (diff)
downloadbcm5719-llvm-98265cae870fa2def132fcd344fe446209f2e7f1.tar.gz
bcm5719-llvm-98265cae870fa2def132fcd344fe446209f2e7f1.zip
Fix a leak in the FastISel code that Chris pointed out.
llvm-svn: 55031
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 6a626b90e3e..1536a641a60 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -5115,6 +5115,14 @@ void SelectionDAGISel::BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
if (FastISel *F = TLI.createFastISel(BB, &FuncInfo.MF,
TLI.getTargetMachine().getInstrInfo())) {
Begin = F->SelectInstructions(Begin, LLVMBB->end(), FuncInfo.ValueMap);
+
+ // Clean up the FastISel object. TODO: Reorganize what data is
+ // stored in the FastISel class itself and what is merely passed
+ // to the SelectInstructions method, and then move the creation
+ // and deletion of the FastISel object up so that it is only
+ // done once per MachineFunction.
+ delete F;
+
if (Begin == LLVMBB->end())
// The "fast" selector selected the entire block, so we're done.
return;
OpenPOWER on IntegriCloud