mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +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:
@@ -72,6 +72,19 @@ bool Value::hasNUses(unsigned N) const {
|
|||||||
return UI == E;
|
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
|
/// 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
|
/// is a linear time operation. Use hasOneUse or hasNUses to check for specific
|
||||||
/// values.
|
/// values.
|
||||||
|
Reference in New Issue
Block a user