From a44f4aeca77c6c1627568fe68e92af9c7e33dc7e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 13 Jan 2005 22:58:50 +0000 Subject: [PATCH] Add a method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19538 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/SelectionDAGNodes.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index be7acb5e361..3627855f146 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 { -- 2.34.1