Skip to content

Retire DynamicValueTypeInfoNeedsUpdate() (NFC) #8386

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

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lldb/include/lldb/Core/ValueObjectDynamicValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ class ValueObjectDynamicValue : public ValueObject {

bool HasDynamicValueTypeInfo() override { return true; }

/// Determine whether the scratch AST context has been replaced
/// since this dynamic type has been created.
bool DynamicValueTypeInfoNeedsUpdate();

CompilerType GetCompilerTypeImpl() override;

Address m_address; ///< The variable that this value object is based upon
Expand Down
11 changes: 0 additions & 11 deletions lldb/source/Core/ValueObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) {

bool did_change_formats = false;

// BEGIN SWIFT
// Swift: Check whether the dynamic type system became stale.
if (m_dynamic_value) {
auto *dyn_val = static_cast<ValueObjectDynamicValue *>(m_dynamic_value);
if (dyn_val->DynamicValueTypeInfoNeedsUpdate()) {
dyn_val->SetNeedsUpdate();
SetNeedsUpdate();
}
}
// END SWIFT

if (update_format)
did_change_formats = UpdateFormatsIfNeeded();

Expand Down
20 changes: 0 additions & 20 deletions lldb/source/Core/ValueObjectDynamicValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,23 +440,3 @@ void ValueObjectDynamicValue::SetLanguageFlags(uint64_t flags) {
else
this->ValueObject::SetLanguageFlags(flags);
}

bool ValueObjectDynamicValue::DynamicValueTypeInfoNeedsUpdate() {
if (GetPreferredDisplayLanguage() != eLanguageTypeSwift)
return false;

if (!m_dynamic_type_info.HasType())
return false;

#ifdef LLDB_ENABLE_SWIFT
auto cached_ctx = m_value.GetCompilerType().GetTypeSystem();
std::optional<SwiftScratchContextReader> scratch_ctx(
GetSwiftScratchContext());

if (!scratch_ctx || !cached_ctx)
return true;
return (void*)cached_ctx.GetSharedPointer().get() != (void*)scratch_ctx->get();
#else // !LLDB_ENABLE_SWIFT
return false;
#endif // LLDB_ENABLE_SWIFT
}