Skip to content

Conversation

@topperc
Copy link
Collaborator

@topperc topperc commented Dec 19, 2024

operator* for this iterator returns Use& so I think the value_type should be Use not Use*.

Noticed while comparing with SDNode::use_iterator.

operator* for this iterator returns Use& so I think the value_type
should be Use not Use*.

Noticed while comparing with SDNode::use_iterator.
@topperc topperc requested a review from nikic December 19, 2024 17:27
@llvmbot
Copy link
Member

llvmbot commented Dec 19, 2024

@llvm/pr-subscribers-llvm-ir

Author: Craig Topper (topperc)

Changes

operator* for this iterator returns Use& so I think the value_type should be Use not Use*.

Noticed while comparing with SDNode::use_iterator.


Full diff: https://github.com/llvm/llvm-project/pull/120609.diff

1 Files Affected:

  • (modified) llvm/include/llvm/IR/Value.h (+1-1)
diff --git a/llvm/include/llvm/IR/Value.h b/llvm/include/llvm/IR/Value.h
index d444a768a65436..011aedece94ab7 100644
--- a/llvm/include/llvm/IR/Value.h
+++ b/llvm/include/llvm/IR/Value.h
@@ -131,7 +131,7 @@ class Value {
 
   public:
     using iterator_category = std::forward_iterator_tag;
-    using value_type = UseT *;
+    using value_type = UseT;
     using difference_type = std::ptrdiff_t;
     using pointer = value_type *;
     using reference = value_type &;

@topperc topperc merged commit 1b12ad1 into llvm:main Dec 20, 2024
10 checks passed
@topperc topperc deleted the pr/use-value_type branch December 20, 2024 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants