Skip to content

Commit dfbc248

Browse files
committed
Swift: mangle opened archetype and fix global actor
1 parent 0aed7d5 commit dfbc248

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

swift/extractor/mangler/SwiftMangler.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,14 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
212212
if (type->isNoEscape()) {
213213
ret << "_noescape";
214214
}
215+
if (type->hasGlobalActor()) {
216+
ret << "_actor" << dispatcher.fetchLabel(type->getGlobalActor());
217+
}
215218
// TODO: see if this needs to be used in identifying types, if not it needs to be removed from
216219
// type printing
217220
assert(type->hasExtInfo() && "type must have ext info");
218-
auto convention = type->getExtInfo().getSILRepresentation();
221+
auto info = type->getExtInfo();
222+
auto convention = info.getSILRepresentation();
219223
if (convention != swift::SILFunctionTypeRepresentation::Thick) {
220224
ret << "_convention" << static_cast<unsigned>(convention);
221225
}
@@ -321,6 +325,14 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType(
321325
return ret;
322326
}
323327

328+
SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) {
329+
auto ret = visitArchetypeType(type);
330+
llvm::SmallVector<char> uuid;
331+
type->getOpenedExistentialID().toString(uuid);
332+
ret << std::string_view(uuid.data(), uuid.size());
333+
return ret;
334+
}
335+
324336
SwiftMangledName SwiftMangler::visitProtocolCompositionType(
325337
const swift::ProtocolCompositionType* type) {
326338
auto ret = initMangled(type);

swift/extractor/mangler/SwiftMangler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
8282
SwiftMangledName visitTypeAliasType(const swift::TypeAliasType* type);
8383
SwiftMangledName visitArchetypeType(const swift::ArchetypeType* type);
8484
SwiftMangledName visitOpaqueTypeArchetypeType(const swift::OpaqueTypeArchetypeType* type);
85+
SwiftMangledName visitOpenedArchetypeType(const swift::OpenedArchetypeType* type);
8586
SwiftMangledName visitProtocolCompositionType(const swift::ProtocolCompositionType* type);
8687
SwiftMangledName visitParenType(const swift::ParenType* type);
8788
SwiftMangledName visitLValueType(const swift::LValueType* type);

0 commit comments

Comments
 (0)