SDOperand::isOperand should not be a forwarding. It must check *this against N's...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 3 Mar 2006 06:42:32 +0000 (06:42 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 3 Mar 2006 06:42:32 +0000 (06:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26502 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 5f66b635749c93ef88a44888c98ab253f3e67e0c..99440aa450dd563f1f1fdeb81007355e89e9f950 100644 (file)
@@ -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);
 }
index 293ea60c33456f85565cc889af3cfed931797302..7312d66dd6be49d72c5935fffae5fa2d934b67d1 100644 (file)
@@ -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)