Skip to content

Commit a10fad6

Browse files
committed
[lldb][Swift][NFC] Add m_valid member in URL formatter
We removed the base-class `SyntheticChildrenFrontEnd::m_valid` member in llvm#164249. The URL formatter is the only user of this and should be able to keep track of its own validity without going through the base.
1 parent e0965f2 commit a10fad6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lldb/source/Plugins/Language/Swift/FoundationValueTypes.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -605,20 +605,18 @@ class URLComponentsSyntheticChildrenFrontEnd
605605
m_synth_backend_up()
606606
#define COMPONENT(Name, PrettyName, ID) , m_##Name(nullptr)
607607
#include "URLComponents.def"
608-
{
609-
SetValid(false);
610-
}
608+
{}
611609

612610
~URLComponentsSyntheticChildrenFrontEnd() override = default;
613611

614612
llvm::Expected<uint32_t> CalculateNumChildren() override {
615-
if (IsValid())
613+
if (m_valid)
616614
return 9;
617615
return 0;
618616
}
619617

620618
lldb::ValueObjectSP GetChildAtIndex(uint32_t idx) override {
621-
if (IsValid()) {
619+
if (m_valid) {
622620
switch (idx) {
623621
#define COMPONENT(Name, PrettyName, ID) \
624622
case ID: \
@@ -646,7 +644,7 @@ class URLComponentsSyntheticChildrenFrontEnd
646644
#define COMPONENT(Name, PrettyName, ID) m_##Name = nullptr;
647645
#include "URLComponents.def"
648646

649-
SetValid(false);
647+
m_valid = false;
650648

651649
ValueObjectSP underlying_sp =
652650
m_backend.GetChildAtNamePath({g__handle, g__pointer});
@@ -686,7 +684,7 @@ class URLComponentsSyntheticChildrenFrontEnd
686684
m_##Name->SetName(GetNameFor##Name());
687685
#include "URLComponents.def"
688686

689-
SetValid(CheckValid());
687+
m_valid = CheckValid();
690688

691689
return ChildCacheState::eRefetch;
692690
}
@@ -712,6 +710,7 @@ class URLComponentsSyntheticChildrenFrontEnd
712710

713711
SyntheticChildrenFrontEnd::AutoPointer m_synth_frontend_up;
714712
std::unique_ptr<ObjCRuntimeSyntheticProvider> m_synth_backend_up;
713+
bool m_valid = false;
715714
#define COMPONENT(Name, PrettyName, ID) ValueObject *m_##Name;
716715
#include "URLComponents.def"
717716

0 commit comments

Comments
 (0)