aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
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
commit37886438dd9e8b734f1a090eb2ede48a4d184f0e (patch)
tree58607ca49796aecca8f3055bf3e124baeb07f39a /lib/Target
parent89934cbd344b6839f4d298b281998a9f48355bf1 (diff)
downloadexternal_llvm-37886438dd9e8b734f1a090eb2ede48a4d184f0e.zip
external_llvm-37886438dd9e8b734f1a090eb2ede48a4d184f0e.tar.gz
external_llvm-37886438dd9e8b734f1a090eb2ede48a4d184f0e.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/Hexagon/HexagonMachineScheduler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/Hexagon/HexagonMachineScheduler.cpp b/lib/Target/Hexagon/HexagonMachineScheduler.cpp
index b73e585..10bb3e9 100644
--- a/lib/Target/Hexagon/HexagonMachineScheduler.cpp
+++ b/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());