@@ -336,7 +336,7 @@ static llvm::Error AddVariableInfo(
336
336
should_not_bind_generic_types &&
337
337
(variable_sp->GetType ()->GetForwardCompilerType ().GetTypeInfo () &
338
338
lldb::eTypeIsPack);
339
-
339
+ bool is_meaningless_without_dynamic_resolution = false ;
340
340
// If we're not binding the generic types, we need to set the self type as an
341
341
// opaque pointer type. This is necessary because we don't bind the generic
342
342
// parameters, and we can't have a type with unbound generics in a non-generic
@@ -349,8 +349,13 @@ static llvm::Error AddVariableInfo(
349
349
CompilerType var_type = SwiftExpressionParser::ResolveVariable (
350
350
variable_sp, stack_frame_sp, runtime, use_dynamic, bind_generic_types);
351
351
352
- Status error;
353
- target_type = ast_context.ImportType (var_type, error);
352
+ is_meaningless_without_dynamic_resolution =
353
+ var_type.IsMeaninglessWithoutDynamicResolution ();
354
+
355
+ // ImportType would only return a TypeRef type anyway, so it's
356
+ // faster to leave the type in its original context for faster
357
+ // type alias resolution.
358
+ target_type = var_type;
354
359
}
355
360
356
361
// If the import failed, give up.
@@ -376,8 +381,7 @@ static llvm::Error AddVariableInfo(
376
381
// If we couldn't fully realize the type, then we aren't going
377
382
// to get very far making a local out of it, so discard it here.
378
383
Log *log = GetLog (LLDBLog::Types | LLDBLog::Expressions);
379
- if (!is_unbound_pack && ts->IsMeaninglessWithoutDynamicResolution (
380
- target_type.GetOpaqueQualType ())) {
384
+ if (is_meaningless_without_dynamic_resolution) {
381
385
if (log)
382
386
log->Printf (" Discarding local %s because we couldn't fully realize it, "
383
387
" our best attempt was: %s." ,
0 commit comments