Skip to content

Conversation

victorvianna
Copy link
Contributor

[1] calls insert in an underlying vector and in C++23 that requires the iterators to satisfy stricter constraints [2][3].

[1]

llvm::append_range(worklist, successors(ToUpdate));

[2]
#if _LIBCPP_STD_VER >= 23
if constexpr (!forward_iterator<_Iterator>) { // Handles input-only sized ranges for insert_range
ranges::copy_n(std::move(__first), __n, __position);
} else
#endif

[3]
template <input_iterator _Ip, weakly_incrementable _Op>

@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2025

@llvm/pr-subscribers-llvm-ir

Author: Victor Vianna (victorvianna)

Changes

[1] calls insert in an underlying vector and in C++23 that requires the iterators to satisfy stricter constraints [2][3].

[1]

llvm::append_range(worklist, successors(ToUpdate));

[2]
#if _LIBCPP_STD_VER >= 23
if constexpr (!forward_iterator<_Iterator>) { // Handles input-only sized ranges for insert_range
ranges::copy_n(std::move(__first), __n, __position);
} else
#endif

[3]
template <input_iterator _Ip, weakly_incrementable _Op>


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

1 Files Affected:

  • (modified) llvm/include/llvm/IR/CFG.h (+4-3)
diff --git a/llvm/include/llvm/IR/CFG.h b/llvm/include/llvm/IR/CFG.h
index 7c7e988fa9e8f..96d3b2fbb5b0b 100644
--- a/llvm/include/llvm/IR/CFG.h
+++ b/llvm/include/llvm/IR/CFG.h
@@ -42,9 +42,9 @@ template <class Ptr, class USE_iterator> // Predecessor Iterator
 class PredIterator {
 public:
   using iterator_category = std::forward_iterator_tag;
-  using value_type = Ptr;
+  using value_type = Ptr *;
   using difference_type = std::ptrdiff_t;
-  using pointer = Ptr *;
+  using pointer = Ptr **;
   using reference = Ptr *;
 
 protected:
@@ -141,7 +141,8 @@ class SuccIterator
                                   std::random_access_iterator_tag, BlockT, int,
                                   BlockT *, BlockT *> {
 public:
-  using difference_type = int;
+  using value_type = BlockT *;
+  using difference_type = std::ptrdiff_t;
   using pointer = BlockT *;
   using reference = BlockT *;
 

@victorvianna
Copy link
Contributor Author

@frgossen PTAL

@frgossen frgossen merged commit 67790d3 into llvm:main Oct 15, 2025
12 checks passed
hubot pushed a commit to google/angle that referenced this pull request Oct 15, 2025
https://chromium.googlesource.com/external/github.com/llvm/llvm-project/+log/fd9a1dcc01766c71932898e9643ce28bf2801bad..67790d3fb06b184b7be9c4d3e36ab01f0ac4198e

The goal is to roll these C++23 fixes [1][2][3][4].

[1] llvm/llvm-project#163555
[2] llvm/llvm-project#163554
[3] llvm/llvm-project#163545
[4] llvm/llvm-project#163553

Bug: chromium:388070065
Change-Id: I23cd9acdfffc9a532e16575a0d4d91a8da72b432
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/7045718
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Victor Vianna <victorvianna@google.com>
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