Skip to content

Commit dc5535c

Browse files
committed
Address review comments
1 parent 82aa5d1 commit dc5535c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
143143
Function *destroy_func = ExtractDestroyFunction(target_sp, frame_ptr_addr);
144144
CompilerType void_type = ast_ctx->GetBasicType(lldb::eBasicTypeVoid);
145145
CompilerType promise_type;
146-
if (CompilerType template_argt =
146+
if (CompilerType template_arg =
147147
valobj_sp->GetCompilerType().GetTypeTemplateArgument(0))
148-
promise_type = std::move(template_argt);
148+
promise_type = std::move(template_arg);
149149
if (promise_type.IsVoidType()) {
150150
// Try to infer the promise_type if it was type-erased
151151
if (destroy_func) {
@@ -168,11 +168,11 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
168168
CompilerType coro_func_ptr_type = coro_func_type.GetPointerType();
169169
ValueObjectSP resume_ptr_sp = CreateValueObjectFromAddress(
170170
"resume", frame_ptr_addr + 0 * ptr_size, exe_ctx, coro_func_ptr_type);
171-
lldbassert(resume_ptr_sp);
171+
assert(resume_ptr_sp);
172172
m_children.push_back(std::move(resume_ptr_sp));
173173
ValueObjectSP destroy_ptr_sp = CreateValueObjectFromAddress(
174174
"destroy", frame_ptr_addr + 1 * ptr_size, exe_ctx, coro_func_ptr_type);
175-
lldbassert(destroy_ptr_sp);
175+
assert(destroy_ptr_sp);
176176
m_children.push_back(std::move(destroy_ptr_sp));
177177

178178
// Add promise and coro_frame
@@ -196,10 +196,9 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
196196
llvm::Expected<size_t>
197197
StdlibCoroutineHandleSyntheticFrontEnd::GetIndexOfChildWithName(
198198
ConstString name) {
199-
for (size_t i = 0, limit = m_children.size(); i < limit; ++i) {
200-
if (m_children[i]->GetName() == name) {
201-
return i;
202-
}
199+
for (const auto &[idx, child_sp] : llvm::enumerate(m_children)) {
200+
if (child_sp->GetName() == name)
201+
return idx;
203202
}
204203

205204
return llvm::createStringError("Type has no child named '%s'",

0 commit comments

Comments
 (0)