diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-01-31 09:59:15 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-01-31 09:59:15 +0000 |
commit | bb81d97feb396a8bb21d074db1c57e9f66525f40 (patch) | |
tree | 1b7fda6273344331e160122778fe96319e45d842 /lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | |
parent | 8535624739e55ab7424eadf792e1a3b4123421c7 (diff) |
Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index c9fc812259..ac35b40d92 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -733,18 +733,16 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, } // Now that we have emitted all operands, emit this instruction itself. - if (Opc == TargetInstrInfo::LABEL && + if (ISD::isDebugLabel(Node) && !BB->empty() && &MF->front() == BB) { - // 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. + // If we are inserting a debug label and this happens to be the first + // debug label in the entry block, it is the "function start" label. + // Make sure there are no other instructions before it. unsigned NumLabels = 0; MachineBasicBlock::iterator MBBI = BB->begin(); while (MBBI != BB->end()) { - if (MBBI->getOpcode() == TargetInstrInfo::LABEL) { - if (++NumLabels > 1) - break; - } + if (!MBBI->isDebugLabel() || ++NumLabels > 1) + break; ++MBBI; } if (NumLabels <= 1) |