aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-13 22:58:50 +0000
committerChris Lattner <sabre@nondot.org>2005-01-13 22:58:50 +0000
commita44f4aeca77c6c1627568fe68e92af9c7e33dc7e (patch)
tree488c1228d6ffef4e3cb8377921c156d876412a46
parent87875dac899f9316b6b02585196cce2f077c08bc (diff)
Add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19538 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index be7acb5e36..3627855f14 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -324,6 +324,10 @@ public:
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 unsigned SDOperand::getNumOperands() const {
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 {