[llvm] IR: Remove null UseList checks in hasNUses methods (PR #165929)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 15:01:13 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Matt Arsenault (arsenm)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/165929.diff
1 Files Affected:
- (modified) llvm/lib/IR/Value.cpp (-8)
``````````diff
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index b775cbb0c7920..95d61a987f6c1 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -148,18 +148,10 @@ void Value::destroyValueName() {
}
bool Value::hasNUses(unsigned N) const {
- if (!UseList)
- return N == 0;
-
- // TODO: Disallow for ConstantData and remove !UseList check?
return hasNItems(use_begin(), use_end(), N);
}
bool Value::hasNUsesOrMore(unsigned N) const {
- // TODO: Disallow for ConstantData and remove !UseList check?
- if (!UseList)
- return N == 0;
-
return hasNItemsOrMore(use_begin(), use_end(), N);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/165929
More information about the llvm-commits
mailing list