-
Couldn't load subscription status.
- Fork 15k
[lldb][ValueObject][NFC] Remove unused SyntheticChildrenFrontEnd member #164249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb][ValueObject][NFC] Remove unused SyntheticChildrenFrontEnd member #164249
Conversation
These `IsValid`/`SetValid` APIs are only ever used from 1 data-formatter in the Swift LLDB fork. Since all the APIs on `SyntheticChildrenFrontEnd` are meant to be overriden, there is no good way to enforce calling `IsValid` from the base. And we should just let that 1 data-formatter manage its own `IsValid` state.
|
@llvm/pr-subscribers-lldb Author: Michael Buch (Michael137) ChangesThese Full diff: https://github.com/llvm/llvm-project/pull/164249.diff 1 Files Affected:
diff --git a/lldb/include/lldb/DataFormatters/TypeSynthetic.h b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
index b147d66def730..4c57a80ee104e 100644
--- a/lldb/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/lldb/include/lldb/DataFormatters/TypeSynthetic.h
@@ -28,13 +28,9 @@ class SyntheticChildrenFrontEnd {
protected:
ValueObject &m_backend;
- void SetValid(bool valid) { m_valid = valid; }
-
- bool IsValid() { return m_valid; }
-
public:
SyntheticChildrenFrontEnd(ValueObject &backend)
- : m_backend(backend), m_valid(true) {}
+ : m_backend(backend) {}
virtual ~SyntheticChildrenFrontEnd() = default;
@@ -100,7 +96,6 @@ class SyntheticChildrenFrontEnd {
CompilerType type);
private:
- bool m_valid;
SyntheticChildrenFrontEnd(const SyntheticChildrenFrontEnd &) = delete;
const SyntheticChildrenFrontEnd &
operator=(const SyntheticChildrenFrontEnd &) = delete;
|
|
✅ With the latest revision this PR passed the C/C++ code 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, IMO almost all IsValid APIs should be replaced by static constructor methods returning llvm::Expected anyway.
…er (llvm#164249) These `IsValid`/`SetValid` APIs are only ever used from 1 data-formatter in the Swift LLDB fork. Since all the APIs on `SyntheticChildrenFrontEnd` are meant to be overriden, there is no good way to enforce calling `IsValid` from the base. And we should just let that 1 data-formatter manage its own `IsValid` state.
These
IsValid/SetValidAPIs are only ever used from 1 data-formatter in the Swift LLDB fork. Since all the APIs onSyntheticChildrenFrontEndare meant to be overriden, there is no good way to enforce callingIsValidfrom the base. And we should just let that 1 data-formatter manage its ownIsValidstate.