1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Add a utility function to SDOperand for testing if a value is unused.

llvm-svn: 42038
This commit is contained in:
Dan Gohman 2007-09-17 17:44:31 +00:00
parent d7742e7939
commit 81b5cda0aa

View File

@ -766,6 +766,10 @@ public:
/// hasOneUse - Return true if there is exactly one operation using this
/// result value of the defining operator.
inline bool hasOneUse() const;
/// use_empty - Return true if there are no operations using this
/// result value of the defining operator.
inline bool use_empty() const;
};
@ -1035,6 +1039,9 @@ inline unsigned SDOperand::getTargetOpcode() const {
inline bool SDOperand::hasOneUse() const {
return Val->hasNUsesOfValue(1, ResNo);
}
inline bool SDOperand::use_empty() const {
return !Val->hasAnyUseOfValue(ResNo);
}
/// UnarySDNode - This class is used for single-operand SDNodes. This is solely
/// to allow co-allocation of node operands with the node itself.