mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Swift: more mangling
This commit is contained in:
@@ -61,6 +61,14 @@ static std::string mangledDeclName(const swift::ValueDecl& decl) {
|
||||
// prefix adds a couple of special symbols, we don't necessary need them
|
||||
return mangler.mangleEntity(&decl);
|
||||
}
|
||||
if (decl.getKind() == swift::DeclKind::GenericTypeParam) {
|
||||
// internal mangling does not distinguish generic type parameters with the same name and
|
||||
// position of different functions. We prepend the context (that is, the function) to
|
||||
// circumvent that
|
||||
auto context = llvm::dyn_cast<swift::ValueDecl>(decl.getDeclContext()->getAsDecl());
|
||||
assert(context);
|
||||
return mangledDeclName(*context) + '_' + mangler.mangleAnyDecl(&decl, /* prefix = */ false);
|
||||
}
|
||||
return mangler.mangleAnyDecl(&decl, /* prefix = */ false);
|
||||
}
|
||||
|
||||
@@ -71,6 +79,7 @@ static fs::path getFilename(swift::ModuleDecl& module,
|
||||
return resolvePath(primaryFile->getFilename());
|
||||
}
|
||||
if (lazyDeclaration) {
|
||||
<<<<<<< HEAD
|
||||
// this code will be thrown away in the near future
|
||||
auto decl = llvm::dyn_cast<swift::ValueDecl>(lazyDeclaration);
|
||||
assert(decl);
|
||||
@@ -85,6 +94,11 @@ static fs::path getFilename(swift::ModuleDecl& module,
|
||||
// half a SHA2 is enough
|
||||
ret += std::string_view(mangled).substr(0, mangled.size() / 2);
|
||||
return ret;
|
||||
=======
|
||||
// static int i;
|
||||
// return mangledDeclName(*lazyDeclaration) + std::to_string(i++);
|
||||
return mangledDeclName(*lazyDeclaration);
|
||||
>>>>>>> 4cbad80695 (Swift: more mangling)
|
||||
}
|
||||
// PCM clang module
|
||||
if (module.isNonSwiftModule()) {
|
||||
|
||||
@@ -153,15 +153,6 @@ class SwiftDispatcher {
|
||||
auto& stored = store[e];
|
||||
if (!stored.valid()) {
|
||||
auto inserted = fetching.insert(e);
|
||||
if (!inserted.second) {
|
||||
if constexpr (IsTypePointer<E>) {
|
||||
std::string dump;
|
||||
llvm::raw_string_ostream oss{dump};
|
||||
e->dump(oss);
|
||||
emitDebugInfo(dump);
|
||||
}
|
||||
return undefined_label;
|
||||
}
|
||||
assert(inserted.second && "detected infinite fetchLabel recursion");
|
||||
stored = createLabel(e, type);
|
||||
fetching.erase(e);
|
||||
|
||||
@@ -21,6 +21,7 @@ struct SwiftMangledName {
|
||||
// streaming labels or ints into a SwiftMangledName just appends them
|
||||
template <typename Tag>
|
||||
SwiftMangledName& operator<<(TrapLabel<Tag> label) {
|
||||
assert(label && "using undefined label in mangled name");
|
||||
parts.emplace_back(label);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ SwiftMangledName SwiftMangler::visitModuleDecl(const swift::ModuleDecl* decl) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitValueDecl(const swift::ValueDecl* decl) {
|
||||
if (!decl->hasName() || decl->getDeclContext()->isLocalContext()) {
|
||||
SwiftMangledName SwiftMangler::visitValueDecl(const swift::ValueDecl* decl, bool force) {
|
||||
if (!force && (!decl->hasName() || decl->getDeclContext()->isLocalContext())) {
|
||||
return {};
|
||||
}
|
||||
auto ret = initMangled(decl);
|
||||
@@ -91,8 +91,12 @@ SwiftMangledName SwiftMangler::visitExtensionDecl(const swift::ExtensionDecl* de
|
||||
if (decl->getDeclContext()->isLocalContext()) {
|
||||
return {};
|
||||
}
|
||||
auto ret = initMangled(decl);
|
||||
auto extended = decl->getExtendedNominal();
|
||||
if (!extended) {
|
||||
// may happen in incomplete ASTs
|
||||
return {};
|
||||
}
|
||||
auto ret = initMangled(decl);
|
||||
ret << dispatcher.fetchLabel(extended);
|
||||
// get the index of all extensions of the same nominal type within this decl's module
|
||||
auto index = 0u;
|
||||
@@ -110,26 +114,25 @@ SwiftMangledName SwiftMangler::visitExtensionDecl(const swift::ExtensionDecl* de
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitGenericTypeDecl(const swift::GenericTypeDecl* decl) {
|
||||
if (auto ret = visitValueDecl(decl)) {
|
||||
if (auto genericParams = decl->getGenericParams()) {
|
||||
ret << '<' << genericParams->size() << '>';
|
||||
}
|
||||
// TODO: almost same code as for function type
|
||||
if (!decl->getGenericRequirements().empty()) {
|
||||
ret << "where_";
|
||||
for (const auto& req : decl->getGenericRequirements()) {
|
||||
ret << dispatcher.fetchLabel(req.getFirstType()->getCanonicalType());
|
||||
ret << (req.getKind() == swift::RequirementKind::SameType ? '=' : ':');
|
||||
if (req.getKind() == swift::RequirementKind::Layout) {
|
||||
ret << '(' << req.getLayoutConstraint().getString() << ')';
|
||||
} else {
|
||||
ret << dispatcher.fetchLabel(req.getSecondType()->getCanonicalType());
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
auto ret = visitValueDecl(decl);
|
||||
if (!ret) {
|
||||
return {};
|
||||
}
|
||||
return {};
|
||||
if (auto genericParams = decl->getParsedGenericParams()) {
|
||||
ret << '<' << genericParams->size() << '>';
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitAbstractTypeParamDecl(
|
||||
const swift::AbstractTypeParamDecl* decl) {
|
||||
return visitValueDecl(decl, /* force */ true);
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitGenericTypeParamDecl(const swift::GenericTypeParamDecl* decl) {
|
||||
auto ret = visitAbstractTypeParamDecl(decl);
|
||||
ret << '_' << decl->getDepth() << '_' << decl->getIndex();
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitModuleType(const swift::ModuleType* type) {
|
||||
@@ -151,7 +154,6 @@ SwiftMangledName SwiftMangler::visitTupleType(const swift::TupleType* type) {
|
||||
|
||||
SwiftMangledName SwiftMangler::visitBuiltinType(const swift::BuiltinType* type) {
|
||||
auto ret = initMangled(type);
|
||||
ret << dispatcher.fetchLabel(type->getASTContext().TheBuiltinModule);
|
||||
llvm::SmallString<32> buffer;
|
||||
ret << type->getTypeName(buffer, /* prependBuiltinNamespace= */ false);
|
||||
return ret;
|
||||
@@ -159,7 +161,8 @@ SwiftMangledName SwiftMangler::visitBuiltinType(const swift::BuiltinType* type)
|
||||
|
||||
SwiftMangledName SwiftMangler::visitAnyGenericType(const swift::AnyGenericType* type) {
|
||||
auto ret = initMangled(type);
|
||||
ret << dispatcher.fetchLabel(type->getDecl());
|
||||
auto decl = type->getDecl();
|
||||
ret << dispatcher.fetchLabel(decl);
|
||||
if (auto parent = type->getParent()) {
|
||||
ret << dispatcher.fetchLabel(parent);
|
||||
}
|
||||
@@ -189,6 +192,9 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
|
||||
if (param.isOwned()) {
|
||||
ret << "_owned";
|
||||
}
|
||||
if (param.isShared()) {
|
||||
ret << "_shared";
|
||||
}
|
||||
if (param.isVariadic()) {
|
||||
ret << "...";
|
||||
}
|
||||
@@ -203,6 +209,9 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
|
||||
if (type->isSendable()) {
|
||||
ret << "_sendable";
|
||||
}
|
||||
if (type->isNoEscape()) {
|
||||
ret << "_noescape";
|
||||
}
|
||||
// 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");
|
||||
@@ -287,9 +296,14 @@ SwiftMangledName SwiftMangler::visitDictionaryType(const swift::DictionaryType*
|
||||
SwiftMangledName SwiftMangler::visitTypeAliasType(const swift::TypeAliasType* type) {
|
||||
auto ret = initMangled(type);
|
||||
ret << dispatcher.fetchLabel(type->getDecl());
|
||||
if (auto parent = type->getParent()) {
|
||||
ret << dispatcher.fetchLabel(parent);
|
||||
}
|
||||
ret << '<';
|
||||
for (auto replacement : type->getSubstitutionMap().getReplacementTypes()) {
|
||||
ret << dispatcher.fetchLabel(replacement);
|
||||
}
|
||||
ret << '>';
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -300,6 +314,13 @@ SwiftMangledName SwiftMangler::visitArchetypeType(const swift::ArchetypeType* ty
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType(
|
||||
const swift::OpaqueTypeArchetypeType* type) {
|
||||
auto ret = visitArchetypeType(type);
|
||||
ret << dispatcher.fetchLabel(type->getDecl());
|
||||
return ret;
|
||||
}
|
||||
|
||||
SwiftMangledName SwiftMangler::visitProtocolCompositionType(
|
||||
const swift::ProtocolCompositionType* type) {
|
||||
auto ret = initMangled(type);
|
||||
|
||||
@@ -43,7 +43,7 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
|
||||
static SwiftMangledName visitDecl(const swift::Decl* decl) { return {}; }
|
||||
|
||||
// current default, falling back to internal mangling
|
||||
SwiftMangledName visitValueDecl(const swift::ValueDecl* decl);
|
||||
SwiftMangledName visitValueDecl(const swift::ValueDecl* decl, bool force = false);
|
||||
|
||||
SwiftMangledName visitModuleDecl(const swift::ModuleDecl* decl);
|
||||
SwiftMangledName visitExtensionDecl(const swift::ExtensionDecl* decl);
|
||||
@@ -51,6 +51,8 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
|
||||
SwiftMangledName visitSubscriptDecl(const swift::SubscriptDecl* decl);
|
||||
SwiftMangledName visitVarDecl(const swift::VarDecl* decl);
|
||||
SwiftMangledName visitGenericTypeDecl(const swift::GenericTypeDecl* decl);
|
||||
SwiftMangledName visitAbstractTypeParamDecl(const swift::AbstractTypeParamDecl* decl);
|
||||
SwiftMangledName visitGenericTypeParamDecl(const swift::GenericTypeParamDecl* decl);
|
||||
|
||||
// default fallback for not yet mangled types. This should never be called in normal situations
|
||||
// TODO: make it assert once we mangle all types
|
||||
@@ -79,6 +81,7 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
|
||||
SwiftMangledName visitDictionaryType(const swift::DictionaryType* type);
|
||||
SwiftMangledName visitTypeAliasType(const swift::TypeAliasType* type);
|
||||
SwiftMangledName visitArchetypeType(const swift::ArchetypeType* type);
|
||||
SwiftMangledName visitOpaqueTypeArchetypeType(const swift::OpaqueTypeArchetypeType* type);
|
||||
SwiftMangledName visitProtocolCompositionType(const swift::ProtocolCompositionType* type);
|
||||
SwiftMangledName visitParenType(const swift::ParenType* type);
|
||||
SwiftMangledName visitLValueType(const swift::LValueType* type);
|
||||
|
||||
@@ -44,6 +44,7 @@ class UntypedTrapLabel {
|
||||
}
|
||||
|
||||
std::string str() const {
|
||||
assert(valid() && "outputting an undefined label!");
|
||||
std::string ret(strSize(), '\0');
|
||||
ret[0] = '#';
|
||||
std::to_chars(ret.data() + 1, ret.data() + ret.size(), id_, 16);
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
[INVALID_KEY_SET] predicate types(@type id, string name, @type_or_none canonical_type): The key set {id} does not functionally determine all fields.
|
||||
Here is a pair of tuples that agree on the key set but differ at index 1:
|
||||
Tuple 1 in row 813: (2081,"<τ_0_0> (_unchecked: Int) -> τ_0_0",2081)
|
||||
Tuple 2 in row 814: (2081,"<τ_0_0> (Int) -> τ_0_0",2081)
|
||||
Relevant element: Tuple 1: id=2081
|
||||
Full ID for 2081: @"GenericFunctionType_(401)->(319)<(319)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_0_0"}<{@"GenericTypeParamType_0_0"}>"
|
||||
Relevant element: Tuple 2: id=2081
|
||||
Full ID for 2081: @"GenericFunctionType_(401)->(319)<(319)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_0_0"}<{@"GenericTypeParamType_0_0"}>"
|
||||
Relevant element: Tuple 1: canonical_type=2081
|
||||
Full ID for 2081: @"GenericFunctionType_(401)->(319)<(319)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_0_0"}<{@"GenericTypeParamType_0_0"}>"
|
||||
Relevant element: Tuple 2: canonical_type=2081
|
||||
Full ID for 2081: @"GenericFunctionType_(401)->(319)<(319)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_0_0"}<{@"GenericTypeParamType_0_0"}>"
|
||||
[INVALID_KEY_SET] predicate types(@type id, string name, @type_or_none canonical_type): The key set {id} does not functionally determine all fields.
|
||||
Here is a pair of tuples that agree on the key set but differ at index 1:
|
||||
Tuple 1 in row 971: (2709,"<Element> (Int) -> Element",2081)
|
||||
Tuple 2 in row 972: (2709,"<Element> (_unchecked: Int) -> Element",2081)
|
||||
Relevant element: Tuple 1: id=2709
|
||||
Full ID for 2709: @"GenericFunctionType_(401)->(2649)<(2607)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_{@"GenericTypeParamDecl_{@"ExtensionDecl_(5)(2052)0"}Element"}"}<{@"GenericTypeParamType_{@"GenericTypeParamDecl_{@"StructDecl_(5)UnsafeMutableBufferPointer<1>"}Element"}"}>"
|
||||
Relevant element: Tuple 2: id=2709
|
||||
Full ID for 2709: @"GenericFunctionType_(401)->(2649)<(2607)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_{@"GenericTypeParamDecl_{@"ExtensionDecl_(5)(2052)0"}Element"}"}<{@"GenericTypeParamType_{@"GenericTypeParamDecl_{@"StructDecl_(5)UnsafeMutableBufferPointer<1>"}Element"}"}>"
|
||||
Relevant element: Tuple 1: canonical_type=2081
|
||||
Full ID for 2081: @"GenericFunctionType_(401)->(319)<(319)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_0_0"}<{@"GenericTypeParamType_0_0"}>"
|
||||
Relevant element: Tuple 2: canonical_type=2081
|
||||
Full ID for 2081: @"GenericFunctionType_(401)->(319)<(319)>". The ID may expand to @"GenericFunctionType_{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}Int"}"}->{@"GenericTypeParamType_0_0"}<{@"GenericTypeParamType_0_0"}>"
|
||||
[INVALID_KEY_SET] predicate types(@type id, string name, @type_or_none canonical_type): The key set {id} does not functionally determine all fields.
|
||||
Here is a pair of tuples that agree on the key set but differ at index 1:
|
||||
Tuple 1 in row 4339: (12488,"Unicode.ASCII.EncodedScalar",12453)
|
||||
Tuple 2 in row 4340: (12488,"Unicode.ASCII.Parser.Encoding.EncodedScalar",12453)
|
||||
Relevant element: Tuple 1: id=12488
|
||||
Full ID for 12488: @"TypeAliasType_(12450)". The ID may expand to @"TypeAliasType_{@"TypeAliasDecl_{@"ExtensionDecl_{@"ModuleDecl_Swift"}{@"EnumDecl_(12442)ASCII"}0"}EncodedScalar"}"
|
||||
Relevant element: Tuple 2: id=12488
|
||||
Full ID for 12488: @"TypeAliasType_(12450)". The ID may expand to @"TypeAliasType_{@"TypeAliasDecl_{@"ExtensionDecl_{@"ModuleDecl_Swift"}{@"EnumDecl_(12442)ASCII"}0"}EncodedScalar"}"
|
||||
Relevant element: Tuple 1: canonical_type=12453
|
||||
Full ID for 12453: @"BoundGenericStructType_(12452)(1736)". The ID may expand to @"BoundGenericStructType_{@"StructDecl_{@"ModuleDecl_Swift"}CollectionOfOne<1>"}{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}UInt8"}"}"
|
||||
Relevant element: Tuple 2: canonical_type=12453
|
||||
Full ID for 12453: @"BoundGenericStructType_(12452)(1736)". The ID may expand to @"BoundGenericStructType_{@"StructDecl_{@"ModuleDecl_Swift"}CollectionOfOne<1>"}{@"StructType_{@"StructDecl_{@"ModuleDecl_Swift"}UInt8"}"}"
|
||||
[INVALID_KEY_SET] predicate types(@type id, string name, @type_or_none canonical_type): The key set {id} does not functionally determine all fields.
|
||||
Here is a pair of tuples that agree on the key set but differ at index 1:
|
||||
Tuple 1 in row 4993: (14194,"<τ_0_0, τ_0_1> (of: τ_0_0) -> τ_0_1",14194)
|
||||
Tuple 2 in row 4994: (14194,"<τ_0_0, τ_0_1> (τ_0_0) -> τ_0_1",14194)
|
||||
Relevant element: Tuple 1: id=14194
|
||||
Full ID for 14194: @"GenericFunctionType_(319)->(331)<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
Relevant element: Tuple 2: id=14194
|
||||
Full ID for 14194: @"GenericFunctionType_(319)->(331)<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
Relevant element: Tuple 1: canonical_type=14194
|
||||
Full ID for 14194: @"GenericFunctionType_(319)->(331)<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
Relevant element: Tuple 2: canonical_type=14194
|
||||
Full ID for 14194: @"GenericFunctionType_(319)->(331)<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
[INVALID_KEY_SET] predicate types(@type id, string name, @type_or_none canonical_type): The key set {id} does not functionally determine all fields.
|
||||
Here is a pair of tuples that agree on the key set but differ at index 1:
|
||||
Tuple 1 in row 5002: (14206,"<τ_0_0, τ_0_1> (τ_0_0, do: (τ_0_0) throws -> τ_0_1) throws -> τ_0_1",14206)
|
||||
Tuple 2 in row 5003: (14206,"<τ_0_0, τ_0_1> (τ_0_0, (τ_0_0) throws -> τ_0_1) throws -> τ_0_1",14206)
|
||||
Relevant element: Tuple 1: id=14206
|
||||
Full ID for 14206: @"GenericFunctionType_(319)(14205)->(331)_throws<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}{@"FunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}_throws"}->{@"GenericTypeParamType_0_1"}_throws<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
Relevant element: Tuple 2: id=14206
|
||||
Full ID for 14206: @"GenericFunctionType_(319)(14205)->(331)_throws<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}{@"FunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}_throws"}->{@"GenericTypeParamType_0_1"}_throws<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
Relevant element: Tuple 1: canonical_type=14206
|
||||
Full ID for 14206: @"GenericFunctionType_(319)(14205)->(331)_throws<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}{@"FunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}_throws"}->{@"GenericTypeParamType_0_1"}_throws<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
Relevant element: Tuple 2: canonical_type=14206
|
||||
Full ID for 14206: @"GenericFunctionType_(319)(14205)->(331)_throws<(319)(331)>". The ID may expand to @"GenericFunctionType_{@"GenericTypeParamType_0_0"}{@"FunctionType_{@"GenericTypeParamType_0_0"}->{@"GenericTypeParamType_0_1"}_throws"}->{@"GenericTypeParamType_0_1"}_throws<{@"GenericTypeParamType_0_0"}{@"GenericTypeParamType_0_1"}>"
|
||||
[INVALID_KEY_SET] predicate types(@type id, string name, @type_or_none canonical_type): More errors, not displayed. There are 27 pairs of tuples not satisfying the key dependency for a relation of size 52810
|
||||
@@ -39,11 +39,15 @@
|
||||
| Sources/deduplication/def.swift:24:36:24:39 | _ | ParamDecl | A [GenericTypeParamType] |
|
||||
| Sources/deduplication/def.swift:24:42:24:45 | _ | ParamDecl | B [GenericTypeParamType] |
|
||||
| Sources/deduplication/def.swift:24:48:24:51 | _ | ParamDecl | C [GenericTypeParamType] |
|
||||
| Sources/deduplication/def.swift:26:1:26:21 | Protocol1 | ProtocolDecl | Protocol1.Protocol [MetatypeType] |
|
||||
| Sources/deduplication/def.swift:27:1:29:1 | Protocol2 | ProtocolDecl | Protocol2.Protocol [MetatypeType] |
|
||||
| Sources/deduplication/def.swift:28:5:28:20 | Associated | AssociatedTypeDecl | Self.Associated.Type [MetatypeType] |
|
||||
| Sources/deduplication/def.swift:30:1:30:14 | Class | ClassDecl | Class.Type [MetatypeType] |
|
||||
| Sources/deduplication/def.swift:30:7:30:7 | Class.deinit() | Deinitializer | (Class) -> () -> () [FunctionType] |
|
||||
| Sources/deduplication/def.swift:30:7:30:7 | Class.init() | Initializer | (Class.Type) -> () -> Class [FunctionType] |
|
||||
| Sources/deduplication/def.swift:30:7:30:7 | self | ParamDecl | Class [ClassType] |
|
||||
| Sources/deduplication/def.swift:30:7:30:7 | self | ParamDecl | Class [ClassType] |
|
||||
| Sources/deduplication/def.swift:32:1:32:128 | def_generic_function_with_conformance(_:_:_:) | ConcreteFuncDecl | <A, B, C where A : Protocol1, A : Protocol2, B : Class, C == A.Associated> (A, B, C) -> () [GenericFunctionType] |
|
||||
| Sources/deduplication/def.swift:32:44:32:60 | A | GenericTypeParamDecl | A.Type [MetatypeType] |
|
||||
| Sources/deduplication/def.swift:32:71:32:75 | B | GenericTypeParamDecl | B.Type [MetatypeType] |
|
||||
| Sources/deduplication/def.swift:32:82:32:82 | C | GenericTypeParamDecl | C.Type [MetatypeType] |
|
||||
@@ -70,6 +74,7 @@
|
||||
| Sources/deduplication/use.swift:6:33:6:36 | _ | ParamDecl | Int [StructType] |
|
||||
| Sources/deduplication/use.swift:7:1:7:61 | use_async_throwing_function_type(_:) | NamedFunction | (Int) async throws -> () [FunctionType] |
|
||||
| Sources/deduplication/use.swift:7:39:7:42 | _ | ParamDecl | Int [StructType] |
|
||||
| Sources/deduplication/use.swift:8:1:8:150 | use_generic_function_with_conformance_type(_:_:_:) | ConcreteFuncDecl | <AA, BB, CC where AA : Protocol1, AA : Protocol2, BB : Class, CC == AA.Associated> (AA, BB, CC) -> () [GenericFunctionType] |
|
||||
| Sources/deduplication/use.swift:8:49:8:49 | AA | GenericTypeParamDecl | AA.Type [MetatypeType] |
|
||||
| Sources/deduplication/use.swift:8:53:8:53 | BB | GenericTypeParamDecl | BB.Type [MetatypeType] |
|
||||
| Sources/deduplication/use.swift:8:57:8:57 | CC | GenericTypeParamDecl | CC.Type [MetatypeType] |
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
// swift-tools-version: 5.5
|
||||
// swift-tools-version: 5.7
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "deduplication",
|
||||
platforms: [
|
||||
.macOS(.v10_15),
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: "deduplication",
|
||||
|
||||
@@ -8,8 +8,11 @@
|
||||
| (Int) throws -> () | FunctionType | def_throwing_function(_:), use_throwing_function_type(_:) | |
|
||||
| (Int, Double) -> Double | FunctionType | def_function_overloaded_on_return(_:_:) | |
|
||||
| (Int, Double) -> Int | FunctionType | def_function_overloaded_on_return(_:_:) | |
|
||||
| <A, B, C where A : Protocol1, A : Protocol2, B : Class, C == A.Associated> (A, B, C) -> () | GenericFunctionType | def_generic_function_with_conformance(_:_:_:) | <\u03c4_0_0, \u03c4_0_1, \u03c4_0_2 where \u03c4_0_0 : Protocol1, \u03c4_0_0 : Protocol2, \u03c4_0_1 : Class, \u03c4_0_2 == \u03c4_0_0.Associated> (\u03c4_0_0, \u03c4_0_1, \u03c4_0_2) -> () |
|
||||
| <A, B, C> (A, B, C) -> () | GenericFunctionType | def_generic_function(_:_:_:) | <\u03c4_0_0, \u03c4_0_1, \u03c4_0_2> (\u03c4_0_0, \u03c4_0_1, \u03c4_0_2) -> () |
|
||||
| <AA, BB, CC where AA : Protocol1, AA : Protocol2, BB : Class, CC == AA.Associated> (AA, BB, CC) -> () | GenericFunctionType | use_generic_function_with_conformance_type(_:_:_:) | <\u03c4_0_0, \u03c4_0_1, \u03c4_0_2 where \u03c4_0_0 : Protocol1, \u03c4_0_0 : Protocol2, \u03c4_0_1 : Class, \u03c4_0_2 == \u03c4_0_0.Associated> (\u03c4_0_0, \u03c4_0_1, \u03c4_0_2) -> () |
|
||||
| <AA, BB, CC> (AA, BB, CC) -> () | GenericFunctionType | use_generic_function_type(_:_:_:) | <\u03c4_0_0, \u03c4_0_1, \u03c4_0_2> (\u03c4_0_0, \u03c4_0_1, \u03c4_0_2) -> () |
|
||||
| <\u03c4_0_0, \u03c4_0_1, \u03c4_0_2 where \u03c4_0_0 : Protocol1, \u03c4_0_0 : Protocol2, \u03c4_0_1 : Class, \u03c4_0_2 == \u03c4_0_0.Associated> (\u03c4_0_0, \u03c4_0_1, \u03c4_0_2) -> () | GenericFunctionType | def_generic_function_with_conformance(_:_:_:), use_generic_function_with_conformance_type(_:_:_:) | |
|
||||
| <\u03c4_0_0, \u03c4_0_1, \u03c4_0_2> (\u03c4_0_0, \u03c4_0_1, \u03c4_0_2) -> () | GenericFunctionType | def_generic_function(_:_:_:), use_generic_function_type(_:_:_:) | |
|
||||
| Generic<Int> | BoundGenericStructType | def_instantiated_generic, use_instantiated_generic | |
|
||||
| Int | StructType | def_int, use_int | |
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | getName: | (Builtin.IntLiteral, Builtin.IntLiteral) | getCanonicalType: | (Builtin.IntLiteral, Builtin.IntLiteral) | getNumberOfTypes: | 2 |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | getName: | (Builtin.IntLiteral, Builtin.IntLiteral) | getCanonicalType: | (Builtin.IntLiteral, Builtin.IntLiteral) | getNumberOfTypes: | 2 |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | getName: | (Builtin.IntLiteral, Builtin.IntLiteral) | getCanonicalType: | (Builtin.IntLiteral, Builtin.IntLiteral) | getNumberOfTypes: | 2 |
|
||||
| (Int, Int, Int, Int, Int) | getName: | (Int, Int, Int, Int, Int) | getCanonicalType: | (Int, Int, Int, Int, Int) | getNumberOfTypes: | 5 |
|
||||
| (Int, String, Double) | getName: | (Int, String, Double) | getCanonicalType: | (Int, String, Double) | getNumberOfTypes: | 3 |
|
||||
| (Int, s: String, Double) | getName: | (Int, s: String, Double) | getCanonicalType: | (Int, s: String, Double) | getNumberOfTypes: | 3 |
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | 0 | Builtin.IntLiteral |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | 0 | Builtin.IntLiteral |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | 0 | Builtin.IntLiteral |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | 1 | Builtin.IntLiteral |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | 1 | Builtin.IntLiteral |
|
||||
| (Builtin.IntLiteral, Builtin.IntLiteral) | 1 | Builtin.IntLiteral |
|
||||
| (Int, Int, Int, Int, Int) | 0 | Int |
|
||||
|
||||
Reference in New Issue
Block a user