aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-01-30 20:08:35 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-01-30 20:08:35 +0000
commit965d1b4bba6107b451edee403c6666acb86f39e3 (patch)
tree00af25d1449afc00d0c1858e7bcf9510b301bfa7 /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
parent43b8f3b7d375187f843181ad3331ea9f06b473f5 (diff)
Treat the label for the first @llvm.dbg.stoppoint the same way as the dbg_func_start label. Make sure nothing else is inserted before them.
Note this solution might be somewhat fragile since ISD::LABEL may be used for other purposes. If that ends up to be an issue, we may need to introduce a different node for debug labels. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAG.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 1b53beddf7..84cd048037 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -716,16 +716,16 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo,
// If we are inserting a LABEL and this happens to be the first label in
// the entry block, it is the "function start" label. Make sure there are
// no other instructions before it.
- bool SeenLabel = false;
+ unsigned NumLabels = 0;
MachineBasicBlock::iterator MBBI = BB->begin();
while (MBBI != BB->end()) {
if (MBBI->getOpcode() == TargetInstrInfo::LABEL) {
- SeenLabel = true;
- break;
+ if (++NumLabels > 1)
+ break;
}
++MBBI;
}
- if (!SeenLabel)
+ if (NumLabels <= 1)
BB->insert(BB->begin(), MI);
else
BB->push_back(MI);