mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Swift: tentatively fix type mangling
This commit is contained in:
@@ -197,19 +197,30 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
|
||||
auto ret = initMangled(type);
|
||||
for (const auto& param : type->getParams()) {
|
||||
ret << fetch(param.getPlainType());
|
||||
if (param.isInOut()) {
|
||||
ret << "_inout";
|
||||
}
|
||||
if (param.isOwned()) {
|
||||
ret << "_owned";
|
||||
}
|
||||
if (param.isShared()) {
|
||||
ret << "_shared";
|
||||
}
|
||||
if (param.isIsolated()) {
|
||||
auto flags = param.getParameterFlags();
|
||||
ret << "_" << getNameForParamSpecifier(flags.getOwnershipSpecifier());
|
||||
if (flags.isIsolated()) {
|
||||
ret << "_isolated";
|
||||
}
|
||||
if (param.isVariadic()) {
|
||||
if (flags.isAutoClosure()) {
|
||||
ret << "_autoclosure";
|
||||
}
|
||||
if (flags.isNonEphemeral()) {
|
||||
ret << "_nonephermeral";
|
||||
}
|
||||
if (flags.isIsolated()) {
|
||||
ret << "_isolated";
|
||||
}
|
||||
if (flags.isSending()) {
|
||||
ret << "_sending";
|
||||
}
|
||||
if (flags.isCompileTimeConst()) {
|
||||
ret << "_compiletimeconst";
|
||||
}
|
||||
if (flags.isNoDerivative()) {
|
||||
ret << "_noderivative";
|
||||
}
|
||||
if (flags.isVariadic()) {
|
||||
ret << "...";
|
||||
}
|
||||
}
|
||||
@@ -219,6 +230,9 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
|
||||
}
|
||||
if (type->isThrowing()) {
|
||||
ret << "_throws";
|
||||
if (type->hasThrownError()) {
|
||||
ret << "(" << fetch(type->getThrownError()) << ")";
|
||||
}
|
||||
}
|
||||
if (type->isSendable()) {
|
||||
ret << "_sendable";
|
||||
|
||||
2
swift/third_party/load.bzl
vendored
2
swift/third_party/load.bzl
vendored
@@ -6,7 +6,7 @@ load("//misc/bazel:lfs.bzl", "lfs_archive", "lfs_files")
|
||||
_override = {
|
||||
# these are used to test new artifacts. Must be empty before merging to main
|
||||
"swift-prebuilt-macOS.tar.zst": "a016ed60ee1a534439ed4d55100ecf6b9fc739f629be20942345ac5156cb6296",
|
||||
"swift-prebuilt-Linux.tar.zst": "54240eb2da948207862ea8eb9bcbfe4447016534b9a8e6d8ee1af67db2a3e73f",
|
||||
"swift-prebuilt-Linux.tar.zst": "c45976d50670964132cef1dcf98bccd3fff809d33b2207a85cf3cfd07ec84528",
|
||||
"resource-dir-macOS.zip": "286e4403aa0a56641c2789e82036481535e336484f2c760bec0f42e3afe5dd87",
|
||||
"resource-dir-Linux.zip": "16a1760f152395377a580a994885e0877338279125834463a6a38f4006ad61ca",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user