diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 118f980..28d7006 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) { |