aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-01-31 09:59:15 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-01-31 09:59:15 +0000
commitbb81d97feb396a8bb21d074db1c57e9f66525f40 (patch)
tree1b7fda6273344331e160122778fe96319e45d842 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent8535624739e55ab7424eadf792e1a3b4123421c7 (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/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 118f980c10..28d7006ac9 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -173,6 +173,22 @@ bool ISD::isBuildVectorAllZeros(const SDNode *N) {
return true;
}
+/// isDebugLabel - Return true if the specified node represents a debug
+/// label (i.e. ISD::LABEL or TargetInstrInfo::LANEL node and third operand
+/// is 0).
+bool ISD::isDebugLabel(const SDNode *N) {
+ SDOperand Zero;
+ if (N->getOpcode() == ISD::LABEL)
+ Zero = N->getOperand(2);
+ else if (N->isTargetOpcode() &&
+ N->getTargetOpcode() == TargetInstrInfo::LABEL)
+ // Chain moved to last operand.
+ Zero = N->getOperand(1);
+ else
+ return false;
+ return isa<ConstantSDNode>(Zero) && cast<ConstantSDNode>(Zero)->isNullValue();
+}
+
/// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
/// when given the operation for (X op Y).
ISD::CondCode ISD::getSetCCSwappedOperands(ISD::CondCode Operation) {