Skip to content

Commit 7d8e26e

Browse files
authored
[lldb] Don't special case Error existential handling in GetValueType (#6749)
This avoids loading Swift ASTContexts (via the call to `ReconstructType`), solely for the purpose of special casing `Error`. Not using ASTContexts will save time performing operations that aren't strictly needed yet. The remainder of this function handles types generally (see `reflection_ctx->isValueInlinedInExistentialContainer`).
1 parent 1ffb9ef commit 7d8e26e

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2829,18 +2829,6 @@ SwiftLanguageRuntimeImpl::GetValueType(ValueObject &in_value,
28292829
// object is a struct? (for a class, it's easy)
28302830
if (static_type_flags.AllSet(eTypeIsSwift | eTypeIsProtocol) &&
28312831
dynamic_type_flags.AnySet(eTypeIsStructUnion | eTypeIsEnumeration)) {
2832-
if (auto ts = static_type.GetTypeSystem()
2833-
.dyn_cast_or_null<TypeSystemSwiftTypeRef>())
2834-
static_type = ts->ReconstructType(static_type);
2835-
auto swift_ast_ctx =
2836-
static_type.GetTypeSystem().dyn_cast_or_null<SwiftASTContext>();
2837-
if (!swift_ast_ctx)
2838-
return {};
2839-
if (swift_ast_ctx->IsErrorType(static_type.GetOpaqueQualType())) {
2840-
// ErrorType values are always a pointer
2841-
return Value::ValueType::LoadAddress;
2842-
}
2843-
28442832
lldb::addr_t existential_address;
28452833
bool use_local_buffer = false;
28462834

0 commit comments

Comments
 (0)