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:
parent
d7742e7939
commit
81b5cda0aa
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user