Add a method

llvm-svn: 19538
This commit is contained in:
Chris Lattner 2005-01-13 22:58:50 +00:00
parent a04c904c4c
commit 7d131a4b9c
1 changed files with 7 additions and 1 deletions

View File

@ -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 {