mirror of
https://github.com/github/codeql.git
synced 2026-04-22 23:35:14 +02:00
Swift: mangle opened archetype and fix global actor
This commit is contained in:
@@ -212,10 +212,14 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
|
||||
if (type->isNoEscape()) {
|
||||
ret << "_noescape";
|
||||
}
|
||||
if (type->hasGlobalActor()) {
|
||||
ret << "_actor" << dispatcher.fetchLabel(type->getGlobalActor());
|
||||
}
|
||||
// TODO: see if this needs to be used in identifying types, if not it needs to be removed from
|
||||
// type printing
|
||||
assert(type->hasExtInfo() && "type must have ext info");
|
||||
auto convention = type->getExtInfo().getSILRepresentation();
|
||||
auto info = type->getExtInfo();
|
||||
auto convention = info.getSILRepresentation();
|
||||
if (convention != swift::SILFunctionTypeRepresentation::Thick) {
|
||||
ret << "_convention" << static_cast<unsigned>(convention);
|
||||
}
|
||||
@@ -321,6 +325,14 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType(
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) {
|
||||
auto ret = visitArchetypeType(type);
|
||||
llvm::SmallVector<char> uuid;
|
||||
type->getOpenedExistentialID().toString(uuid);
|
||||
ret << std::string_view(uuid.data(), uuid.size());
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitProtocolCompositionType(
|
||||
const swift::ProtocolCompositionType* type) {
|
||||
auto ret = initMangled(type);
|
||||
|
||||
@@ -82,6 +82,7 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
|
||||
SwiftMangledName visitTypeAliasType(const swift::TypeAliasType* type);
|
||||
SwiftMangledName visitArchetypeType(const swift::ArchetypeType* type);
|
||||
SwiftMangledName visitOpaqueTypeArchetypeType(const swift::OpaqueTypeArchetypeType* type);
|
||||
SwiftMangledName visitOpenedArchetypeType(const swift::OpenedArchetypeType* type);
|
||||
SwiftMangledName visitProtocolCompositionType(const swift::ProtocolCompositionType* type);
|
||||
SwiftMangledName visitParenType(const swift::ParenType* type);
|
||||
SwiftMangledName visitLValueType(const swift::LValueType* type);
|
||||
|
||||
Reference in New Issue
Block a user