[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 13 14:59:02 PST 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.13 -> 1.14
---
Log message:

Add a method


---
Diffs of the changes:  (+7 -1)

Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.13 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.14
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.13	Thu Jan 13 14:49:26 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Thu Jan 13 16:58:50 2005
@@ -324,6 +324,10 @@
   inline unsigned getOpcode() const;
   inline unsigned getNumOperands() const;
   inline const SDOperand &getOperand(unsigned i) const;
+
+  /// hasOneUse - Return true if there is exactly one operation using this
+  /// result value of the defining operator.
+  inline bool hasOneUse() const;
 };
 
 
@@ -481,7 +485,9 @@
 inline const SDOperand &SDOperand::getOperand(unsigned i) const {
   return Val->getOperand(i);
 }
-
+inline bool SDOperand::hasOneUse() const {
+  return Val->hasNUsesOfValue(1, ResNo);
+}
 
 
 class ConstantSDNode : public SDNode {






More information about the llvm-commits mailing list