aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h7
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
2 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 5f66b63574..99440aa450 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -531,6 +531,9 @@ public:
return SDOperand(Val, R);
}
+ // isOperand - Return true if this node is an operand of N.
+ bool isOperand(SDNode *N) const;
+
/// getValueType - Return the ValueType of the referenced return value.
///
inline MVT::ValueType getValueType() const;
@@ -542,7 +545,6 @@ public:
inline const SDOperand &getOperand(unsigned i) const;
inline bool isTargetOpcode() const;
inline unsigned getTargetOpcode() const;
- inline const bool isOperand(SDNode *N) const;
/// hasOneUse - Return true if there is exactly one operation using this
/// result value of the defining operator.
@@ -941,9 +943,6 @@ inline bool SDOperand::isTargetOpcode() const {
inline unsigned SDOperand::getTargetOpcode() const {
return Val->getTargetOpcode();
}
-inline const bool SDOperand::isOperand(SDNode *N) const {
- return Val->isOperand(N);
-}
inline bool SDOperand::hasOneUse() const {
return Val->hasNUsesOfValue(1, ResNo);
}
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 293ea60c33..7312d66dd6 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2534,6 +2534,13 @@ bool SDNode::isOnlyUse(SDNode *N) const {
}
// isOperand - Return true if this node is an operand of N.
+bool SDOperand::isOperand(SDNode *N) const {
+ for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i)
+ if (*this == N->getOperand(i))
+ return true;
+ return false;
+}
+
bool SDNode::isOperand(SDNode *N) const {
for (unsigned i = 0, e = N->NumOperands; i != e; ++i)
if (this == N->OperandList[i].Val)