mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-25 12:50:00 +00:00
new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
977a39570f
commit
8daf056c90
@ -72,6 +72,19 @@ bool Value::hasNUses(unsigned N) const {
|
||||
return UI == E;
|
||||
}
|
||||
|
||||
/// hasNUsesOrMore - Return true if this value has N users or more. This is
|
||||
/// logically equivalent to getNumUses() >= N.
|
||||
///
|
||||
bool Value::hasNUsesOrMore(unsigned N) const {
|
||||
use_const_iterator UI = use_begin(), E = use_end();
|
||||
|
||||
for (; N; --N, ++UI)
|
||||
if (UI == E) return false; // Too few.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// getNumUses - This method computes the number of uses of this Value. This
|
||||
/// is a linear time operation. Use hasOneUse or hasNUses to check for specific
|
||||
/// values.
|
||||
|
Loading…
Reference in New Issue
Block a user