aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-10 22:42:31 +0000
committerDan Gohman <gohman@apple.com>2010-07-10 22:42:31 +0000
commita8dab36f3dfdfcd3f74224afa4ffb32776674c93 (patch)
treed6d6bd334c9230dc427600c48932b9c5891aa84e /lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
parente695de0c5f0924fcb667ccf19d141491869a9c5e (diff)
downloadexternal_llvm-a8dab36f3dfdfcd3f74224afa4ffb32776674c93.zip
external_llvm-a8dab36f3dfdfcd3f74224afa4ffb32776674c93.tar.gz
external_llvm-a8dab36f3dfdfcd3f74224afa4ffb32776674c93.tar.bz2
Fix a bug in the code which re-inserts DBG_VALUE nodes after scheduling;
if a block is split (by a custom inserter), the insert point may be in a different block than it was originally. This fixes 32-bit llvm-gcc bootstrap builds, and I haven't been able to reproduce it otherwise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 2673eba..06cf053 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -642,8 +642,10 @@ MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
// Insert to start of the BB (after PHIs).
BB->insert(BBBegin, DbgMI);
else {
+ // Insert at the instruction, which may be in a different
+ // block, if the block was split by a custom inserter.
MachineBasicBlock::iterator Pos = MI;
- BB->insert(llvm::next(Pos), DbgMI);
+ MI->getParent()->insert(llvm::next(Pos), DbgMI);
}
}
}