66//
77// ===----------------------------------------------------------------------===//
88
9+ #include " llvm/ADT/Sequence.h"
910#include " llvm/Support/Error.h"
1011#include < optional>
1112#if LLDB_ENABLE_SWIFT
@@ -210,8 +211,10 @@ FindTaskIds(llvm::ArrayRef<std::optional<addr_t>> maybe_task_addrs,
210211 // Move the results into the slots not filled by errors from the input.
211212 llvm::ArrayRef<std::optional<addr_t >> results_ref = read_results;
212213 for (std::optional<addr_t > &maybe_result : final_results)
213- if (maybe_result)
214- maybe_result = results_ref.consume_front ();
214+ if (maybe_result) {
215+ maybe_result = results_ref.front ();
216+ results_ref = results_ref.drop_front ();
217+ }
215218 assert (results_ref.empty ());
216219
217220 return final_results;
@@ -232,8 +235,11 @@ bool OperatingSystemSwiftTasks::UpdateThreadList(ThreadList &old_thread_list,
232235 llvm::SmallVector<std::optional<addr_t >> task_ids =
233236 FindTaskIds (task_addrs, *m_process);
234237
235- for (const auto &[real_thread, task_addr, task_id] :
236- llvm::zip (locked_core_threads, task_addrs, task_ids)) {
238+ for (uint64_t idx : llvm::seq<uint64_t >(task_addrs.size ())) {
239+ auto real_thread =
240+ core_thread_list.GetThreadAtIndex (idx, /* can_update=*/ false );
241+ auto task_addr = task_addrs[idx];
242+ auto task_id = task_ids[idx];
237243 // If this is not a thread running a Task, add it to the list as is.
238244 if (!task_id) {
239245 LLDB_LOG (log,
0 commit comments