Skip to content

Commit 15ed58b

Browse files
committed
[Swift] Update for frontend API changes
1 parent 96c7323 commit 15ed58b

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ void SwiftASTManipulator::FindVariableDeclarations(
530530

531531
size_t persistent_info_location = m_variables.size();
532532

533-
auto type = var_decl->getDeclContext()->mapTypeIntoContext(
534-
var_decl->getInterfaceType());
533+
auto type = var_decl->getTypeInContext();
535534
m_variables.emplace_back(ToCompilerType({type.getPointer()}), name,
536535
var_decl);
537536
found_declarations.push_back(persistent_info_location);
@@ -859,8 +858,7 @@ GetPatternBindingForVarDecl(swift::VarDecl *var_decl,
859858
}
860859
}
861860
}
862-
swift::Type type = containing_context->mapTypeIntoContext(
863-
var_decl->getInterfaceType());
861+
swift::Type type = var_decl->getTypeInContext();
864862
swift::TypedPattern *typed_pattern =
865863
swift::TypedPattern::createImplicit(ast_context, named_pattern, type);
866864

@@ -947,7 +945,7 @@ llvm::Expected<swift::Type> SwiftASTManipulator::GetSwiftTypeForVariable(
947945
}
948946

949947
if (swift_type->hasArchetype())
950-
swift_type = swift_type->mapTypeOutOfContext();
948+
swift_type = swift_type->mapTypeOutOfEnvironment();
951949

952950
return {swift_type};
953951
}

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ MaterializeVariable(SwiftASTManipulatorBase::VariableInfo &variable,
992992
"transformed type is empty");
993993

994994
actual_type =
995-
ToCompilerType(transformed_type->mapTypeOutOfContext().getPointer());
995+
ToCompilerType(transformed_type->mapTypeOutOfEnvironment().getPointer());
996996
auto swift_ast_ctx =
997997
actual_type.GetTypeSystem().dyn_cast_or_null<SwiftASTContext>();
998998
if (!swift_ast_ctx)

lldb/source/Plugins/ExpressionParser/Swift/SwiftSILManipulator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ swift::SILValue SwiftSILManipulator::emitLValueForVariable(
103103
swift::LoadInst *pointer_to_variable =
104104
m_builder.createLoad(null_loc, pointer_to_return_slot,
105105
swift::LoadOwnershipQualifier::Trivial);
106-
auto type = var->getDeclContext()->mapTypeIntoContext(
107-
var->getInterfaceType());
106+
auto type = var->getTypeInContext();
108107
auto loweredType = converter.getLoweredRValueType(
109108
swift::TypeExpansionContext::minimal(), type);
110109

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ SwiftLanguageRuntime::BindGenericTypeParametersRemoteAST(
300300
llvm::expectedToStdOptional(swift_ast_ctx->GetSwiftType(base_type))
301301
.value_or(swift::Type()));
302302
if (target_swift_type->hasArchetype())
303-
target_swift_type = target_swift_type->mapTypeOutOfContext().getPointer();
303+
target_swift_type = target_swift_type->mapTypeOutOfEnvironment().getPointer();
304304

305305
ThreadSafeASTContext ast_ctx = swift_ast_ctx->GetASTContext();
306306
if (!ast_ctx)

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8390,7 +8390,7 @@ CompilerType SwiftASTContext::GetUnboundGenericType(opaque_compiler_type_t type,
83908390
llvm::ArrayRef<swift::GenericTypeParamType *> params =
83918391
generic_sig.getGenericParams();
83928392
swift::Type paramTy = params[idx];
8393-
return ToCompilerType({nominal_type_decl->mapTypeIntoContext(paramTy)
8393+
return ToCompilerType({nominal_type_decl->mapTypeIntoEnvironment(paramTy)
83948394
->castTo<swift::ArchetypeType>()});
83958395
}
83968396

0 commit comments

Comments
 (0)