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.
// isOnlyUse - Return true if this node is the only use of N.
bool isOnlyUse(SDNode *N) const;
+ // isOperand - Return true if this node is an operand of N.
+ bool isOperand(SDNode *N) const;
+
/// getNumOperands - Return the number of values used by this operation.
///
unsigned getNumOperands() const { return NumOperands; }
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);
}
return Seen;
}
+// isOperand - Return true if this node is an operand of N.
+bool SDNode::isOperand(SDNode *N) const {
+ for (unsigned i = 0, e = N->NumOperands; i != e; ++i)
+ if (this == N->OperandList[i].Val)
+ return true;
+ return false;
+}
const char *SDNode::getOperationName(const SelectionDAG *G) const {
switch (getOpcode()) {