@@ -248,11 +248,6 @@ bool lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetDataType() {
248
248
deref = m_root_node->Dereference (error);
249
249
if (!deref || error.Fail ())
250
250
return false ;
251
- deref = deref->GetChildMemberWithName (" __value_" );
252
- if (deref) {
253
- m_element_type = deref->GetCompilerType ();
254
- return true ;
255
- }
256
251
deref = m_backend.GetChildAtNamePath ({" __tree_" , " __pair3_" });
257
252
if (!deref)
258
253
return false ;
@@ -280,40 +275,35 @@ void lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset(
280
275
return ;
281
276
if (!node)
282
277
return ;
278
+
283
279
CompilerType node_type (node->GetCompilerType ());
284
- uint64_t bit_offset;
285
- if (node_type.GetIndexOfFieldWithName (" __value_" , nullptr , &bit_offset) !=
286
- UINT32_MAX) {
287
- // Old layout (pre d05b10ab4fc65)
288
- m_skip_size = bit_offset / 8u ;
289
- } else {
290
- auto ast_ctx = node_type.GetTypeSystem ().dyn_cast_or_null <TypeSystemClang>();
291
- if (!ast_ctx)
292
- return ;
293
- CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier (
294
- llvm::StringRef (),
295
- {{" ptr0" , ast_ctx->GetBasicType (lldb::eBasicTypeVoid).GetPointerType ()},
296
- {" ptr1" , ast_ctx->GetBasicType (lldb::eBasicTypeVoid).GetPointerType ()},
297
- {" ptr2" , ast_ctx->GetBasicType (lldb::eBasicTypeVoid).GetPointerType ()},
298
- {" cw" , ast_ctx->GetBasicType (lldb::eBasicTypeBool)},
299
- {" payload" , (m_element_type.GetCompleteType (), m_element_type)}});
300
- std::string child_name;
301
- uint32_t child_byte_size;
302
- int32_t child_byte_offset = 0 ;
303
- uint32_t child_bitfield_bit_size;
304
- uint32_t child_bitfield_bit_offset;
305
- bool child_is_base_class;
306
- bool child_is_deref_of_parent;
307
- uint64_t language_flags;
308
- auto child_type =
309
- llvm::expectedToStdOptional (tree_node_type.GetChildCompilerTypeAtIndex (
310
- nullptr , 4 , true , true , true , child_name, child_byte_size,
311
- child_byte_offset, child_bitfield_bit_size,
312
- child_bitfield_bit_offset, child_is_base_class,
313
- child_is_deref_of_parent, nullptr , language_flags));
314
- if (child_type && child_type->IsValid ())
315
- m_skip_size = (uint32_t )child_byte_offset;
316
- }
280
+ auto ast_ctx = node_type.GetTypeSystem ().dyn_cast_or_null <TypeSystemClang>();
281
+ if (!ast_ctx)
282
+ return ;
283
+
284
+ CompilerType tree_node_type = ast_ctx->CreateStructForIdentifier (
285
+ llvm::StringRef (),
286
+ {{" ptr0" , ast_ctx->GetBasicType (lldb::eBasicTypeVoid).GetPointerType ()},
287
+ {" ptr1" , ast_ctx->GetBasicType (lldb::eBasicTypeVoid).GetPointerType ()},
288
+ {" ptr2" , ast_ctx->GetBasicType (lldb::eBasicTypeVoid).GetPointerType ()},
289
+ {" cw" , ast_ctx->GetBasicType (lldb::eBasicTypeBool)},
290
+ {" payload" , (m_element_type.GetCompleteType (), m_element_type)}});
291
+ std::string child_name;
292
+ uint32_t child_byte_size;
293
+ int32_t child_byte_offset = 0 ;
294
+ uint32_t child_bitfield_bit_size;
295
+ uint32_t child_bitfield_bit_offset;
296
+ bool child_is_base_class;
297
+ bool child_is_deref_of_parent;
298
+ uint64_t language_flags;
299
+ auto child_type =
300
+ llvm::expectedToStdOptional (tree_node_type.GetChildCompilerTypeAtIndex (
301
+ nullptr , 4 , true , true , true , child_name, child_byte_size,
302
+ child_byte_offset, child_bitfield_bit_size, child_bitfield_bit_offset,
303
+ child_is_base_class, child_is_deref_of_parent, nullptr ,
304
+ language_flags));
305
+ if (child_type && child_type->IsValid ())
306
+ m_skip_size = (uint32_t )child_byte_offset;
317
307
}
318
308
319
309
ValueObjectSP
@@ -348,14 +338,8 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetKeyValuePair(
348
338
return nullptr ;
349
339
350
340
GetValueOffset (iterated_sp);
351
- auto child_sp = iterated_sp->GetChildMemberWithName (" __value_" );
352
- if (child_sp) {
353
- // Old layout (pre 089a7cc5dea)
354
- iterated_sp = child_sp;
355
- } else {
356
- iterated_sp = iterated_sp->GetSyntheticChildAtOffset (
357
- m_skip_size, m_element_type, true );
358
- }
341
+ iterated_sp = iterated_sp->GetSyntheticChildAtOffset (m_skip_size,
342
+ m_element_type, true );
359
343
360
344
if (!iterated_sp)
361
345
return nullptr ;
0 commit comments