Skip to content

Commit 0421676

Browse files
committed
Don't hoist generic types into SwiftASTContext
after generic type parameter binding. We still transfer them into the scratch TypeSystemSwiftTypeRef though. rdar://88470211
1 parent 8836b23 commit 0421676

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,6 @@ SwiftLanguageRuntimeImpl::BindGenericTypeParameters(StackFrame &stack_frame,
20152015
const swift::reflection::TypeRef *bound_type_ref =
20162016
type_ref->subst(reflection_ctx->getBuilder(), substitutions);
20172017
NodePointer node = bound_type_ref->getDemangling(dem);
2018-
CompilerType bound_type = ts.RemangleAsType(dem, node);
20192018

20202019
// Import the type into the scratch context. Subsequent conversions
20212020
// to Swift types must be performed in the scratch context, since
@@ -2037,15 +2036,7 @@ SwiftLanguageRuntimeImpl::BindGenericTypeParameters(StackFrame &stack_frame,
20372036
"No scratch context available.");
20382037
return ts.GetTypeFromMangledTypename(mangled_name);
20392038
}
2040-
SwiftASTContext *swift_ast_ctx = scratch_ctx->GetSwiftASTContext();
2041-
if (!swift_ast_ctx) {
2042-
LLDB_LOG(GetLog(LLDBLog::Expressions | LLDBLog::Types),
2043-
"No scratch context available.");
2044-
return ts.GetTypeFromMangledTypename(mangled_name);
2045-
}
2046-
2047-
bound_type = swift_ast_ctx->ImportType(bound_type, error);
2048-
2039+
CompilerType bound_type = scratch_ctx->RemangleAsType(dem, node);
20492040
LLDB_LOG(GetLog(LLDBLog::Expressions | LLDBLog::Types), "Bound {0} -> {1}.",
20502041
mangled_name, bound_type.GetMangledTypeName());
20512042
return bound_type;

0 commit comments

Comments
 (0)