Skip to content

Commit a0d730e

Browse files
committed
[rebranch][lldb] Remove duplicate code
3116987 moved the switch in `ValueObjectVariable::UpdateValue` to `ValueObject::UpdateChildrenAddressType`. 31c4cc7 then reverted this change. e337350 looks to have re-applied it but moved `ValueObject::UpdateChildrenAddressType` down into `ValueObjectVariable::UpdateChildrenAddressType` and 6b16a52 enabled calling it again. Neither of these remove the old switch in `ValueObjectVariable::UpdateValue` though. Remove the duplicate switch.
1 parent 22c9a68 commit a0d730e

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

lldb/source/Core/ValueObjectVariable.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -215,50 +215,6 @@ bool ValueObjectVariable::UpdateValue() {
215215

216216
Process *process = exe_ctx.GetProcessPtr();
217217
const bool process_is_alive = process && process->IsAlive();
218-
const uint32_t type_info = compiler_type.GetTypeInfo();
219-
const bool is_pointer_or_ref =
220-
(type_info & (lldb::eTypeIsPointer | lldb::eTypeIsReference)) != 0;
221-
222-
switch (value_type) {
223-
case Value::ValueType::FileAddress:
224-
// If this type is a pointer, then its children will be considered load
225-
// addresses if the pointer or reference is dereferenced, but only if
226-
// the process is alive.
227-
//
228-
// There could be global variables like in the following code:
229-
// struct LinkedListNode { Foo* foo; LinkedListNode* next; };
230-
// Foo g_foo1;
231-
// Foo g_foo2;
232-
// LinkedListNode g_second_node = { &g_foo2, NULL };
233-
// LinkedListNode g_first_node = { &g_foo1, &g_second_node };
234-
//
235-
// When we aren't running, we should be able to look at these variables
236-
// using the "target variable" command. Children of the "g_first_node"
237-
// always will be of the same address type as the parent. But children
238-
// of the "next" member of LinkedListNode will become load addresses if
239-
// we have a live process, or remain what a file address if it what a
240-
// file address.
241-
if (process_is_alive && is_pointer_or_ref)
242-
SetAddressTypeOfChildren(eAddressTypeLoad);
243-
else
244-
SetAddressTypeOfChildren(eAddressTypeFile);
245-
break;
246-
case Value::ValueType::HostAddress:
247-
// Same as above for load addresses, except children of pointer or refs
248-
// are always load addresses. Host addresses are used to store freeze
249-
// dried variables. If this type is a struct, the entire struct
250-
// contents will be copied into the heap of the
251-
// LLDB process, but we do not currently follow any pointers.
252-
if (is_pointer_or_ref)
253-
SetAddressTypeOfChildren(eAddressTypeLoad);
254-
else
255-
SetAddressTypeOfChildren(eAddressTypeHost);
256-
break;
257-
case Value::ValueType::LoadAddress:
258-
case Value::ValueType::Scalar:
259-
SetAddressTypeOfChildren(eAddressTypeLoad);
260-
break;
261-
}
262218

263219
#ifdef LLDB_ENABLE_SWIFT
264220
if (auto type = variable->GetType())

0 commit comments

Comments
 (0)