Skip to content

Commit df32657

Browse files
committed
fixup! rename cases to eReuse/eRefetch
1 parent d0d3c45 commit df32657

31 files changed

+173
-174
lines changed

lldb/include/lldb/DataFormatters/TypeSynthetic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class SyntheticChildrenFrontEnd {
5353
/// should know to deal with it in the correct way (most probably, by refusing
5454
/// to return any children). The return value of \ref Update should actually
5555
/// be interpreted as "ValueObjectSyntheticFilter cache is good/bad". If this
56-
/// function returns \ref lldb::ChildCacheState::eConstant, \ref
56+
/// function returns \ref lldb::ChildCacheState::eReuse, \ref
5757
/// ValueObjectSyntheticFilter is allowed to use the children it fetched
5858
/// previously and cached. Otherwise, \ref ValueObjectSyntheticFilter must
5959
/// throw away its cache, and query again for children.
@@ -118,7 +118,7 @@ class SyntheticValueProviderFrontEnd : public SyntheticChildrenFrontEnd {
118118
}
119119

120120
lldb::ChildCacheState Update() override {
121-
return lldb::ChildCacheState::eDynamic;
121+
return lldb::ChildCacheState::eRefetch;
122122
}
123123

124124
bool MightHaveChildren() override { return false; }
@@ -332,7 +332,7 @@ class TypeFilterImpl : public SyntheticChildren {
332332
}
333333

334334
lldb::ChildCacheState Update() override {
335-
return lldb::ChildCacheState::eDynamic;
335+
return lldb::ChildCacheState::eRefetch;
336336
}
337337

338338
bool MightHaveChildren() override { return filter->GetCount() > 0; }

lldb/include/lldb/lldb-enumerations.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,9 +1308,8 @@ enum CompletionType {
13081308
/// Specifies if children need to be re-computed
13091309
/// after a call to \ref SyntheticChildrenFrontEnd::Update.
13101310
enum class ChildCacheState {
1311-
eDynamic = 0, ///< Children need to be recomputed dynamically.
1312-
eConstant =
1313-
1, ///< Children will never change and don't need to be recomputed.
1311+
eRefetch = 0, ///< Children need to be recomputed dynamically.
1312+
eReuse = 1, ///< Children will never change and don't need to be recomputed.
13141313
};
13151314

13161315
} // namespace lldb

lldb/source/Core/ValueObjectSyntheticFilter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DummySyntheticFrontEnd : public SyntheticChildrenFrontEnd {
4444
bool MightHaveChildren() override { return m_backend.MightHaveChildren(); }
4545

4646
lldb::ChildCacheState Update() override {
47-
return lldb::ChildCacheState::eConstant;
47+
return lldb::ChildCacheState::eReuse;
4848
}
4949
};
5050

@@ -179,7 +179,7 @@ bool ValueObjectSynthetic::UpdateValue() {
179179
}
180180

181181
// let our backend do its update
182-
if (m_synth_filter_up->Update() == lldb::ChildCacheState::eConstant) {
182+
if (m_synth_filter_up->Update() == lldb::ChildCacheState::eReuse) {
183183
LLDB_LOGF(log,
184184
"[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
185185
"filter said caches are stale - clearing",

lldb/source/DataFormatters/TypeSynthetic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren(uint32_t max) {
192192

193193
lldb::ChildCacheState ScriptedSyntheticChildren::FrontEnd::Update() {
194194
if (!m_wrapper_sp || m_interpreter == nullptr)
195-
return lldb::ChildCacheState::eDynamic;
195+
return lldb::ChildCacheState::eRefetch;
196196

197197
return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp)
198-
? lldb::ChildCacheState::eConstant
199-
: lldb::ChildCacheState::eDynamic;
198+
? lldb::ChildCacheState::eReuse
199+
: lldb::ChildCacheState::eRefetch;
200200
}
201201

202202
bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {

lldb/source/DataFormatters/VectorType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class VectorTypeSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
258258
::CalculateNumChildren(element_type, num_elements, m_child_type)
259259
.value_or(0);
260260
m_item_format = GetItemFormatForFormat(m_parent_format, m_child_type);
261-
return lldb::ChildCacheState::eDynamic;
261+
return lldb::ChildCacheState::eRefetch;
262262
}
263263

264264
bool MightHaveChildren() override { return true; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class BlockPointerSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
137137
// return true if this object is now safe to use forever without ever
138138
// updating again; the typical (and tested) answer here is 'false'
139139
lldb::ChildCacheState Update() override {
140-
return lldb::ChildCacheState::eDynamic;
140+
return lldb::ChildCacheState::eRefetch;
141141
}
142142

143143
// maybe return false if the block pointer is, say, null

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
133133

134134
ValueObjectSP valobj_sp = m_backend.GetNonSyntheticValue();
135135
if (!valobj_sp)
136-
return lldb::ChildCacheState::eDynamic;
136+
return lldb::ChildCacheState::eRefetch;
137137

138138
lldb::addr_t frame_ptr_addr = GetCoroFramePtrFromHandle(valobj_sp);
139139
if (frame_ptr_addr == 0 || frame_ptr_addr == LLDB_INVALID_ADDRESS)
140-
return lldb::ChildCacheState::eDynamic;
140+
return lldb::ChildCacheState::eRefetch;
141141

142142
auto ts = valobj_sp->GetCompilerType().GetTypeSystem();
143143
auto ast_ctx = ts.dyn_cast_or_null<TypeSystemClang>();
144144
if (!ast_ctx)
145-
return lldb::ChildCacheState::eDynamic;
145+
return lldb::ChildCacheState::eRefetch;
146146

147147
// Create the `resume` and `destroy` children.
148148
lldb::TargetSP target_sp = m_backend.GetTargetSP();
@@ -165,7 +165,7 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
165165
CompilerType promise_type(
166166
valobj_sp->GetCompilerType().GetTypeTemplateArgument(0));
167167
if (!promise_type)
168-
return lldb::ChildCacheState::eDynamic;
168+
return lldb::ChildCacheState::eRefetch;
169169

170170
// Try to infer the promise_type if it was type-erased
171171
if (promise_type.IsVoidType()) {
@@ -180,7 +180,7 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
180180
// If we don't know the promise type, we don't display the `promise` member.
181181
// `CreateValueObjectFromAddress` below would fail for `void` types.
182182
if (promise_type.IsVoidType()) {
183-
return lldb::ChildCacheState::eDynamic;
183+
return lldb::ChildCacheState::eRefetch;
184184
}
185185

186186
// Add the `promise` member. We intentionally add `promise` as a pointer type
@@ -194,7 +194,7 @@ lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::Update() {
194194
if (error.Success())
195195
m_promise_ptr_sp = promisePtr->Clone(ConstString("promise"));
196196

197-
return lldb::ChildCacheState::eDynamic;
197+
return lldb::ChildCacheState::eRefetch;
198198
}
199199

200200
bool lldb_private::formatters::StdlibCoroutineHandleSyntheticFrontEnd::

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ lldb::ChildCacheState GenericBitsetFrontEnd::Update() {
8484

8585
TargetSP target_sp = m_backend.GetTargetSP();
8686
if (!target_sp)
87-
return lldb::ChildCacheState::eDynamic;
87+
return lldb::ChildCacheState::eRefetch;
8888

8989
size_t size = 0;
9090

@@ -94,7 +94,7 @@ lldb::ChildCacheState GenericBitsetFrontEnd::Update() {
9494
m_elements.assign(size, ValueObjectSP());
9595
m_first =
9696
m_backend.GetChildMemberWithName(GetDataContainerMemberName()).get();
97-
return lldb::ChildCacheState::eDynamic;
97+
return lldb::ChildCacheState::eRefetch;
9898
}
9999

100100
ValueObjectSP GenericBitsetFrontEnd::GetChildAtIndex(size_t idx) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ lldb::ChildCacheState GenericOptionalFrontend::Update() {
7171
->GetChildMemberWithName("_M_engaged");
7272

7373
if (!engaged_sp)
74-
return lldb::ChildCacheState::eDynamic;
74+
return lldb::ChildCacheState::eRefetch;
7575

7676
// _M_engaged/__engaged is a bool flag and is true if the optional contains a
7777
// value. Converting it to unsigned gives us a size of 1 if it contains a
7878
// value and 0 if not.
7979
m_has_value = engaged_sp->GetValueAsUnsigned(0) != 0;
8080

81-
return lldb::ChildCacheState::eDynamic;
81+
return lldb::ChildCacheState::eRefetch;
8282
}
8383

8484
ValueObjectSP GenericOptionalFrontend::GetChildAtIndex(size_t _idx) {

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
238238

239239
ValueObjectSP valobj_sp = m_backend.GetSP();
240240
if (!valobj_sp)
241-
return lldb::ChildCacheState::eDynamic;
241+
return lldb::ChildCacheState::eRefetch;
242242

243243
TargetSP target_sp(valobj_sp->GetTargetSP());
244244

245245
if (!target_sp)
246-
return lldb::ChildCacheState::eDynamic;
246+
return lldb::ChildCacheState::eRefetch;
247247

248248
if (!valobj_sp)
249-
return lldb::ChildCacheState::eDynamic;
249+
return lldb::ChildCacheState::eRefetch;
250250

251251
// this must be a ValueObject* because it is a child of the ValueObject we
252252
// are producing children for it if were a ValueObjectSP, we would end up
@@ -279,7 +279,7 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
279279
auto __i_(valobj_sp->GetChildMemberWithName("__i_"));
280280
if (!__i_) {
281281
m_pair_ptr = nullptr;
282-
return lldb::ChildCacheState::eDynamic;
282+
return lldb::ChildCacheState::eRefetch;
283283
}
284284
CompilerType pair_type(
285285
__i_->GetCompilerType().GetTypeTemplateArgument(0));
@@ -291,7 +291,7 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
291291
0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
292292
if (!pair_type) {
293293
m_pair_ptr = nullptr;
294-
return lldb::ChildCacheState::eDynamic;
294+
return lldb::ChildCacheState::eRefetch;
295295
}
296296

297297
auto addr(m_pair_ptr->GetValueAsUnsigned(LLDB_INVALID_ADDRESS));
@@ -300,7 +300,7 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
300300
auto ts = pair_type.GetTypeSystem();
301301
auto ast_ctx = ts.dyn_cast_or_null<TypeSystemClang>();
302302
if (!ast_ctx)
303-
return lldb::ChildCacheState::eDynamic;
303+
return lldb::ChildCacheState::eRefetch;
304304

305305
// Mimick layout of std::__tree_iterator::__ptr_ and read it in
306306
// from process memory.
@@ -329,14 +329,14 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
329329
{"payload", pair_type}});
330330
std::optional<uint64_t> size = tree_node_type.GetByteSize(nullptr);
331331
if (!size)
332-
return lldb::ChildCacheState::eDynamic;
332+
return lldb::ChildCacheState::eRefetch;
333333
WritableDataBufferSP buffer_sp(new DataBufferHeap(*size, 0));
334334
ProcessSP process_sp(target_sp->GetProcessSP());
335335
Status error;
336336
process_sp->ReadMemory(addr, buffer_sp->GetBytes(),
337337
buffer_sp->GetByteSize(), error);
338338
if (error.Fail())
339-
return lldb::ChildCacheState::eDynamic;
339+
return lldb::ChildCacheState::eRefetch;
340340
DataExtractor extractor(buffer_sp, process_sp->GetByteOrder(),
341341
process_sp->GetAddressByteSize());
342342
auto pair_sp = CreateValueObjectFromData(
@@ -348,7 +348,7 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
348348
}
349349
}
350350

351-
return lldb::ChildCacheState::eDynamic;
351+
return lldb::ChildCacheState::eRefetch;
352352
}
353353

354354
size_t lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::
@@ -407,15 +407,15 @@ lldb::ChildCacheState lldb_private::formatters::
407407

408408
ValueObjectSP valobj_sp = m_backend.GetSP();
409409
if (!valobj_sp)
410-
return lldb::ChildCacheState::eDynamic;
410+
return lldb::ChildCacheState::eRefetch;
411411

412412
TargetSP target_sp(valobj_sp->GetTargetSP());
413413

414414
if (!target_sp)
415-
return lldb::ChildCacheState::eDynamic;
415+
return lldb::ChildCacheState::eRefetch;
416416

417417
if (!valobj_sp)
418-
return lldb::ChildCacheState::eDynamic;
418+
return lldb::ChildCacheState::eRefetch;
419419

420420
auto exprPathOptions = ValueObject::GetValueForExpressionPathOptions()
421421
.DontCheckDotVsArrowSyntax()
@@ -438,7 +438,7 @@ lldb::ChildCacheState lldb_private::formatters::
438438
auto iter_child(valobj_sp->GetChildMemberWithName("__i_"));
439439
if (!iter_child) {
440440
m_iter_ptr = nullptr;
441-
return lldb::ChildCacheState::eDynamic;
441+
return lldb::ChildCacheState::eRefetch;
442442
}
443443

444444
CompilerType node_type(iter_child->GetCompilerType()
@@ -456,19 +456,19 @@ lldb::ChildCacheState lldb_private::formatters::
456456
0, name, &bit_offset_ptr, &bitfield_bit_size_ptr, &is_bitfield_ptr);
457457
if (!pair_type) {
458458
m_iter_ptr = nullptr;
459-
return lldb::ChildCacheState::eDynamic;
459+
return lldb::ChildCacheState::eRefetch;
460460
}
461461

462462
uint64_t addr = m_iter_ptr->GetValueAsUnsigned(LLDB_INVALID_ADDRESS);
463463
m_iter_ptr = nullptr;
464464

465465
if (addr == 0 || addr == LLDB_INVALID_ADDRESS)
466-
return lldb::ChildCacheState::eDynamic;
466+
return lldb::ChildCacheState::eRefetch;
467467

468468
auto ts = pair_type.GetTypeSystem();
469469
auto ast_ctx = ts.dyn_cast_or_null<TypeSystemClang>();
470470
if (!ast_ctx)
471-
return lldb::ChildCacheState::eDynamic;
471+
return lldb::ChildCacheState::eRefetch;
472472

473473
// Mimick layout of std::__hash_iterator::__node_ and read it in
474474
// from process memory.
@@ -490,14 +490,14 @@ lldb::ChildCacheState lldb_private::formatters::
490490
{"__value_", pair_type}});
491491
std::optional<uint64_t> size = tree_node_type.GetByteSize(nullptr);
492492
if (!size)
493-
return lldb::ChildCacheState::eDynamic;
493+
return lldb::ChildCacheState::eRefetch;
494494
WritableDataBufferSP buffer_sp(new DataBufferHeap(*size, 0));
495495
ProcessSP process_sp(target_sp->GetProcessSP());
496496
Status error;
497497
process_sp->ReadMemory(addr, buffer_sp->GetBytes(),
498498
buffer_sp->GetByteSize(), error);
499499
if (error.Fail())
500-
return lldb::ChildCacheState::eDynamic;
500+
return lldb::ChildCacheState::eRefetch;
501501
DataExtractor extractor(buffer_sp, process_sp->GetByteOrder(),
502502
process_sp->GetAddressByteSize());
503503
auto pair_sp = CreateValueObjectFromData(
@@ -506,7 +506,7 @@ lldb::ChildCacheState lldb_private::formatters::
506506
m_pair_sp = pair_sp->GetChildAtIndex(2);
507507
}
508508

509-
return lldb::ChildCacheState::eDynamic;
509+
return lldb::ChildCacheState::eRefetch;
510510
}
511511

512512
size_t lldb_private::formatters::LibCxxUnorderedMapIteratorSyntheticFrontEnd::
@@ -607,17 +607,17 @@ lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEnd::Update() {
607607

608608
ValueObjectSP valobj_sp = m_backend.GetSP();
609609
if (!valobj_sp)
610-
return lldb::ChildCacheState::eDynamic;
610+
return lldb::ChildCacheState::eRefetch;
611611

612612
TargetSP target_sp(valobj_sp->GetTargetSP());
613613
if (!target_sp)
614-
return lldb::ChildCacheState::eDynamic;
614+
return lldb::ChildCacheState::eRefetch;
615615

616616
lldb::ValueObjectSP cntrl_sp(valobj_sp->GetChildMemberWithName("__cntrl_"));
617617

618618
m_cntrl = cntrl_sp.get(); // need to store the raw pointer to avoid a circular
619619
// dependency
620-
return lldb::ChildCacheState::eDynamic;
620+
return lldb::ChildCacheState::eRefetch;
621621
}
622622

623623
bool lldb_private::formatters::LibcxxSharedPtrSyntheticFrontEnd::
@@ -695,11 +695,11 @@ lldb::ChildCacheState
695695
lldb_private::formatters::LibcxxUniquePtrSyntheticFrontEnd::Update() {
696696
ValueObjectSP valobj_sp = m_backend.GetSP();
697697
if (!valobj_sp)
698-
return lldb::ChildCacheState::eDynamic;
698+
return lldb::ChildCacheState::eRefetch;
699699

700700
ValueObjectSP ptr_sp(valobj_sp->GetChildMemberWithName("__ptr_"));
701701
if (!ptr_sp)
702-
return lldb::ChildCacheState::eDynamic;
702+
return lldb::ChildCacheState::eRefetch;
703703

704704
// Retrieve the actual pointer and the deleter, and clone them to give them
705705
// user-friendly names.
@@ -711,7 +711,7 @@ lldb_private::formatters::LibcxxUniquePtrSyntheticFrontEnd::Update() {
711711
if (deleter_sp)
712712
m_deleter_sp = deleter_sp->Clone(ConstString("deleter"));
713713

714-
return lldb::ChildCacheState::eDynamic;
714+
return lldb::ChildCacheState::eRefetch;
715715
}
716716

717717
bool lldb_private::formatters::LibcxxUniquePtrSyntheticFrontEnd::

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::Update() {
116116
if (atomic_value)
117117
m_real_child = GetLibCxxAtomicValue(m_backend).get();
118118

119-
return lldb::ChildCacheState::eDynamic;
119+
return lldb::ChildCacheState::eRefetch;
120120
}
121121

122122
bool lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::Update() {
8888
m_num_elements = 0;
8989
m_element_type = m_backend.GetCompilerType().GetTypeTemplateArgument(0);
9090
if (!m_element_type.IsValid())
91-
return lldb::ChildCacheState::eDynamic;
91+
return lldb::ChildCacheState::eRefetch;
9292

9393
if (std::optional<uint64_t> size = m_element_type.GetByteSize(nullptr)) {
9494
m_element_size = *size;
9595
// Store raw pointers or end up with a circular dependency.
9696
m_start = m_backend.GetChildMemberWithName("__begin_").get();
9797
}
9898

99-
return lldb::ChildCacheState::eDynamic;
99+
return lldb::ChildCacheState::eRefetch;
100100
}
101101

102102
bool lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::

0 commit comments

Comments
 (0)