summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-07-27 10:48:45 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-07-27 10:48:45 +0000
commitc18e39ca83307c0ca78db957a2ebbab04854415d (patch)
tree70178607840db16e3edfd58d43f7cffad8cf3682 /llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
parentd45abe12a6001b3cfd4ef2fdbbd516dc2a43597c (diff)
downloadbcm5719-llvm-c18e39ca83307c0ca78db957a2ebbab04854415d.tar.gz
bcm5719-llvm-c18e39ca83307c0ca78db957a2ebbab04854415d.zip
Fix a memory leak in the hexagon scheduler. We call initialize here more
than once, and the second time through we leaked memory. Found thanks to the vg-leak bot, but I can't locally reproduce it with valgrind. The debugger confirms that it is in fact leaking here. This whole code is totally gross. Why is initialize being called on each runOnFunction??? Why aren't these OwningPtr<>s, and why aren't their lifetimes better defined? Anyways, this is just a surgical change to help out the leak checking bots. llvm-svn: 187299
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp b/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
index b73e58538e0..10bb3e91f2d 100644
--- a/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
@@ -208,6 +208,8 @@ void ConvergingVLIWScheduler::initialize(ScheduleDAGMI *dag) {
Top.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
Bot.HazardRec = TM.getInstrInfo()->CreateTargetMIHazardRecognizer(Itin, DAG);
+ delete Top.ResourceModel;
+ delete Bot.ResourceModel;
Top.ResourceModel = new VLIWResourceModel(TM, DAG->getSchedModel());
Bot.ResourceModel = new VLIWResourceModel(TM, DAG->getSchedModel());
OpenPOWER on IntegriCloud