Skip to content

Commit 172972d

Browse files
authored
Merge pull request #17357 from DougGregor/mangle-more-standard-substitutions-4.2
[4.2] [Mangling] Mangle more standard substitutions
2 parents 255e747 + 46ae13b commit 172972d

File tree

71 files changed

+423
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+423
-334
lines changed

docs/ABI/Mangling.rst

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,27 +329,63 @@ Types
329329
any-generic-type ::= protocol 'P' // nominal protocol type
330330
any-generic-type ::= context decl-name 'a' // typealias type (used in DWARF and USRs)
331331

332-
any-generic-type ::= 'S' KNOWN-TYPE-KIND // known nominal type substitution
333-
any-generic-type ::= 'S' NATURAL KNOWN-TYPE-KIND // repeated known type substitutions of the same kind
332+
any-generic-type ::= standard-substitutions
333+
334+
standard-substitutions ::= 'S' KNOWN-TYPE-KIND // known nominal type substitution
335+
standard-substitutions ::= 'S' NATURAL KNOWN-TYPE-KIND // repeated known type substitutions of the same kind
334336

337+
KNOWN-TYPE-KIND ::= 'A' // Swift.AutoreleasingUnsafeMutablePointer
335338
KNOWN-TYPE-KIND ::= 'a' // Swift.Array
339+
KNOWN-TYPE-KIND ::= 'B' // Swift.BinaryFloatingPoint
336340
KNOWN-TYPE-KIND ::= 'b' // Swift.Bool
337341
KNOWN-TYPE-KIND ::= 'c' // Swift.UnicodeScalar
342+
KNOWN-TYPE-KIND ::= 'd' // Swift.Dictionary
338343
KNOWN-TYPE-KIND ::= 'd' // Swift.Float64
344+
KNOWN-TYPE-KIND ::= 'E' // Swift.Encodable
345+
KNOWN-TYPE-KIND ::= 'e' // Swift.Decodable
346+
KNOWN-TYPE-KIND ::= 'F' // Swift.FloatingPoint
339347
KNOWN-TYPE-KIND ::= 'f' // Swift.Float32
348+
KNOWN-TYPE-KIND ::= 'G' // Swift.RandomNumberGenerator
349+
KNOWN-TYPE-KIND ::= 'H' // Swift.Hashable
350+
KNOWN-TYPE-KIND ::= 'h' // Swift.Set
351+
KNOWN-TYPE-KIND ::= 'I' // Swift.DefaultIndices
340352
KNOWN-TYPE-KIND ::= 'i' // Swift.Int
341-
KNOWN-TYPE-KIND ::= 'V' // Swift.UnsafeRawPointer
342-
KNOWN-TYPE-KIND ::= 'v' // Swift.UnsafeMutableRawPointer
353+
KNOWN-TYPE-KIND ::= 'J' // Swift.Character
354+
KNOWN-TYPE-KIND ::= 'j' // Swift.Numeric
355+
KNOWN-TYPE-KIND ::= 'K' // Swift.BidirectionalCollection
356+
KNOWN-TYPE-KIND ::= 'k' // Swift.RandomAccessCollection
357+
KNOWN-TYPE-KIND ::= 'L' // Swift.Comparable
358+
KNOWN-TYPE-KIND ::= 'l' // Swift.Collection
359+
KNOWN-TYPE-KIND ::= 'M' // Swift.MutableCollection
360+
KNOWN-TYPE-KIND ::= 'm' // Swift.RangeReplaceableCollection
361+
KNOWN-TYPE-KIND ::= 'N' // Swift.ClosedRange
362+
KNOWN-TYPE-KIND ::= 'n' // Swift.Range
363+
KNOWN-TYPE-KIND ::= 'O' // Swift.ObjectIdentifier
343364
KNOWN-TYPE-KIND ::= 'P' // Swift.UnsafePointer
344365
KNOWN-TYPE-KIND ::= 'p' // Swift.UnsafeMutablePointer
345-
KNOWN-TYPE-KIND ::= 'Q' // Swift.ImplicitlyUnwrappedOptional
366+
KNOWN-TYPE-KIND ::= 'Q' // Swift.Equatable
346367
KNOWN-TYPE-KIND ::= 'q' // Swift.Optional
347368
KNOWN-TYPE-KIND ::= 'R' // Swift.UnsafeBufferPointer
348369
KNOWN-TYPE-KIND ::= 'r' // Swift.UnsafeMutableBufferPointer
349370
KNOWN-TYPE-KIND ::= 'S' // Swift.String
371+
KNOWN-TYPE-KIND ::= 's' // Swift.Substring
372+
KNOWN-TYPE-KIND ::= 'T' // Swift.Sequence
373+
KNOWN-TYPE-KIND ::= 't' // Swift.IteratorProtocol
374+
KNOWN-TYPE-KIND ::= 'U' // Swift.UnsignedInteger
350375
KNOWN-TYPE-KIND ::= 'u' // Swift.UInt
376+
KNOWN-TYPE-KIND ::= 'V' // Swift.UnsafeRawPointer
377+
KNOWN-TYPE-KIND ::= 'v' // Swift.UnsafeMutableRawPointer
378+
KNOWN-TYPE-KIND ::= 'W' // Swift.UnsafeRawBufferPointer
379+
KNOWN-TYPE-KIND ::= 'w' // Swift.UnsafeMutableRawBufferPointer
380+
KNOWN-TYPE-KIND ::= 'X' // Swift.RangeExpression
381+
KNOWN-TYPE-KIND ::= 'x' // Swift.Strideable
382+
KNOWN-TYPE-KIND ::= 'Y' // Swift.RawRepresentable
383+
KNOWN-TYPE-KIND ::= 'y' // Swift.StringProtocol
384+
KNOWN-TYPE-KIND ::= 'Z' // Swift.SignedInteger
385+
KNOWN-TYPE-KIND ::= 'z' // Swift.BinaryInteger
351386

352387
protocol ::= context decl-name
388+
protocol ::= standard-substitutions
353389

354390
type ::= 'Bb' // Builtin.BridgeObject
355391
type ::= 'BB' // Builtin.UnsafeValueBuffer

include/swift/AST/ASTMangler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ class ASTMangler : public Mangler {
208208

209209
void appendModule(const ModuleDecl *module);
210210

211-
void appendProtocolName(const ProtocolDecl *protocol);
211+
void appendProtocolName(const ProtocolDecl *protocol,
212+
bool allowStandardSubstitution = true);
212213

213214
void appendAnyGenericType(const GenericTypeDecl *decl);
214215

include/swift/Demangling/StandardTypesMangling.def

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,56 @@
1313
/// STANDARD_TYPE(KIND, MANGLING, TYPENAME)
1414
/// The 1-character MANGLING for a known TYPENAME of KIND.
1515

16+
STANDARD_TYPE(Structure, A, AutoreleasingUnsafeMutablePointer)
1617
STANDARD_TYPE(Structure, a, Array)
1718
STANDARD_TYPE(Structure, b, Bool)
1819
STANDARD_TYPE(Structure, c, UnicodeScalar)
20+
STANDARD_TYPE(Structure, D, Dictionary)
1921
STANDARD_TYPE(Structure, d, Double)
2022
STANDARD_TYPE(Structure, f, Float)
23+
STANDARD_TYPE(Structure, h, Set)
24+
STANDARD_TYPE(Structure, I, DefaultIndices)
2125
STANDARD_TYPE(Structure, i, Int)
22-
STANDARD_TYPE(Structure, V, UnsafeRawPointer)
23-
STANDARD_TYPE(Structure, v, UnsafeMutableRawPointer)
26+
STANDARD_TYPE(Structure, J, Character)
27+
STANDARD_TYPE(Structure, N, ClosedRange)
28+
STANDARD_TYPE(Structure, n, Range)
29+
STANDARD_TYPE(Structure, O, ObjectIdentifier)
2430
STANDARD_TYPE(Structure, P, UnsafePointer)
2531
STANDARD_TYPE(Structure, p, UnsafeMutablePointer)
2632
STANDARD_TYPE(Structure, R, UnsafeBufferPointer)
2733
STANDARD_TYPE(Structure, r, UnsafeMutableBufferPointer)
2834
STANDARD_TYPE(Structure, S, String)
35+
STANDARD_TYPE(Structure, s, Substring)
2936
STANDARD_TYPE(Structure, u, UInt)
37+
STANDARD_TYPE(Structure, V, UnsafeRawPointer)
38+
STANDARD_TYPE(Structure, v, UnsafeMutableRawPointer)
39+
STANDARD_TYPE(Structure, W, UnsafeRawBufferPointer)
40+
STANDARD_TYPE(Structure, w, UnsafeMutableRawBufferPointer)
3041

3142
STANDARD_TYPE(Enum, q, Optional)
32-
STANDARD_TYPE(Enum, Q, ImplicitlyUnwrappedOptional)
43+
44+
STANDARD_TYPE(Protocol, B, BinaryFloatingPoint)
45+
STANDARD_TYPE(Protocol, E, Encodable)
46+
STANDARD_TYPE(Protocol, e, Decodable)
47+
STANDARD_TYPE(Protocol, F, FloatingPoint)
48+
STANDARD_TYPE(Protocol, G, RandomNumberGenerator)
49+
STANDARD_TYPE(Protocol, H, Hashable)
50+
STANDARD_TYPE(Protocol, j, Numeric)
51+
STANDARD_TYPE(Protocol, K, BidirectionalCollection)
52+
STANDARD_TYPE(Protocol, k, RandomAccessCollection)
53+
STANDARD_TYPE(Protocol, L, Comparable)
54+
STANDARD_TYPE(Protocol, l, Collection)
55+
STANDARD_TYPE(Protocol, M, MutableCollection)
56+
STANDARD_TYPE(Protocol, m, RangeReplaceableCollection)
57+
STANDARD_TYPE(Protocol, Q, Equatable)
58+
STANDARD_TYPE(Protocol, T, Sequence)
59+
STANDARD_TYPE(Protocol, t, IteratorProtocol)
60+
STANDARD_TYPE(Protocol, U, UnsignedInteger)
61+
STANDARD_TYPE(Protocol, X, RangeExpression)
62+
STANDARD_TYPE(Protocol, x, Strideable)
63+
STANDARD_TYPE(Protocol, Y, RawRepresentable)
64+
STANDARD_TYPE(Protocol, y, StringProtocol)
65+
STANDARD_TYPE(Protocol, Z, SignedInteger)
66+
STANDARD_TYPE(Protocol, z, BinaryInteger)
3367

3468
#undef STANDARD_TYPE

lib/AST/ASTMangler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,11 @@ void ASTMangler::appendModule(const ModuleDecl *module) {
14921492
}
14931493

14941494
/// Mangle the name of a protocol as a substitution candidate.
1495-
void ASTMangler::appendProtocolName(const ProtocolDecl *protocol) {
1495+
void ASTMangler::appendProtocolName(const ProtocolDecl *protocol,
1496+
bool allowStandardSubstitution) {
1497+
if (allowStandardSubstitution && tryAppendStandardSubstitution(protocol))
1498+
return;
1499+
14961500
appendContextOf(protocol);
14971501
auto *clangDecl = protocol->getClangDecl();
14981502
if (auto *clangProto = cast_or_null<clang::ObjCProtocolDecl>(clangDecl))

lib/Demangling/Demangler.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,17 @@ NodePointer Demangler::popTypeList() {
11951195
}
11961196

11971197
NodePointer Demangler::popProtocol() {
1198+
if (NodePointer Type = popNode(Node::Kind::Type)) {
1199+
if (Type->getNumChildren() < 1)
1200+
return nullptr;
1201+
1202+
NodePointer Proto = Type->getChild(0);
1203+
if (Proto->getKind() != Node::Kind::Protocol)
1204+
return nullptr;
1205+
1206+
return Type;
1207+
}
1208+
11981209
NodePointer Name = popNode(isDeclName);
11991210
NodePointer Ctx = popContext();
12001211
NodePointer Proto = createWithChildren(Node::Kind::Protocol, Ctx, Name);

lib/Demangling/OldRemangler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,9 @@ void Remangler::mangleProtocol(Node *node, EntityContext &ctx) {
17541754
}
17551755

17561756
void Remangler::mangleProtocolWithoutPrefix(Node *node) {
1757+
if (mangleStandardSubstitution(node))
1758+
return;
1759+
17571760
if (node->getKind() == Node::Kind::Type) {
17581761
assert(node->getNumChildren() == 1);
17591762
node = node->begin()[0];

lib/Demangling/Remangler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ class Remangler {
248248
}
249249

250250
void manglePureProtocol(Node *Proto) {
251+
if (mangleStandardSubstitution(Proto))
252+
return;
253+
251254
Proto = skipType(Proto);
252255
mangleChildNodes(Proto);
253256
}
@@ -354,7 +357,8 @@ void Remangler::mangleIdentifierImpl(Node *node, bool isOperator) {
354357

355358
bool Remangler::mangleStandardSubstitution(Node *node) {
356359
if (node->getKind() != Node::Kind::Structure
357-
&& node->getKind() != Node::Kind::Enum)
360+
&& node->getKind() != Node::Kind::Enum
361+
&& node->getKind() != Node::Kind::Protocol)
358362
return false;
359363

360364
Node *context = node->getFirstChild();

lib/IRGen/IRGenMangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ std::string IRGenMangler::mangleTypeForLLVMTypeName(CanType Ty) {
120120
// don't start with a digit and don't need to be quoted.
121121
Buffer << 'T';
122122
if (auto P = dyn_cast<ProtocolType>(Ty)) {
123-
appendProtocolName(P->getDecl());
123+
appendProtocolName(P->getDecl(), /*allowStandardSubstitution=*/false);
124124
appendOperator("P");
125125
} else {
126126
appendType(Ty);

lib/IRGen/IRGenMangler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class IRGenMangler : public Mangle::ASTMangler {
109109

110110
std::string mangleBareProtocol(const ProtocolDecl *Decl) {
111111
beginMangling();
112-
appendProtocolName(Decl);
112+
appendProtocolName(Decl, /*allowStandardSubstitution=*/false);
113113
appendOperator("P");
114114
return finalize();
115115
}
@@ -344,7 +344,7 @@ class IRGenMangler : public Mangle::ASTMangler {
344344

345345
std::string mangleForProtocolDescriptor(ProtocolType *Proto) {
346346
beginMangling();
347-
appendProtocolName(Proto->getDecl());
347+
appendProtocolName(Proto->getDecl(), /*allowStandardSubstitution=*/false);
348348
appendOperator("P");
349349
return finalize();
350350
}

stdlib/public/SDK/Foundation/NSError.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
MANGLE_SYM(So10CFErrorRefas5Error10FoundationWa)();
2222

2323
extern "C" const SWIFT_CC(swift) hashable_support::HashableWitnessTable *
24-
MANGLE_SYM(So8NSObjectCs8Hashable10ObjectiveCWa)();
24+
MANGLE_SYM(So8NSObjectCSH10ObjectiveCWa)();
2525

2626
extern "C" SWIFT_CC(swift)
2727
NSDictionary *MANGLE_SYM(10Foundation24_getErrorDefaultUserInfoyyXlSgxs0C0RzlF)(
@@ -37,7 +37,7 @@
3737
// Define the bridging info struct.
3838
extern "C" ErrorBridgingInfo ERROR_BRIDGING_SYMBOL_NAME = {
3939
MANGLE_SYM(So10CFErrorRefas5Error10FoundationWa),
40-
MANGLE_SYM(So8NSObjectCs8Hashable10ObjectiveCWa),
40+
MANGLE_SYM(So8NSObjectCSH10ObjectiveCWa),
4141
MANGLE_SYM(10Foundation24_getErrorDefaultUserInfoyyXlSgxs0C0RzlF),
4242
MANGLE_SYM(10Foundation21_bridgeNSErrorToError_3outSbSo0C0C_SpyxGtAA021_ObjectiveCBridgeableE0RzlF),
4343
&MANGLE_SYM(10Foundation26_ObjectiveCBridgeableErrorMp)

stdlib/public/runtime/Casting.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,10 +2152,10 @@ static bool tryDynamicCastBoxedSwiftValue(OpaqueValue *dest,
21522152
extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(Sa);
21532153

21542154
/// Nominal type descriptor for Swift.Dictionary.
2155-
extern "C" const StructDescriptor STRUCT_TYPE_DESCR_SYM(s10Dictionary);
2155+
extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(SD);
21562156

21572157
/// Nominal type descriptor for Swift.Set.
2158-
extern "C" const StructDescriptor STRUCT_TYPE_DESCR_SYM(s3Set);
2158+
extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(Sh);
21592159

21602160
// internal func _arrayDownCastIndirect<SourceValue, TargetValue>(
21612161
// _ source: UnsafePointer<Array<SourceValue>>,
@@ -2269,7 +2269,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
22692269
}
22702270

22712271
// Dictionaries.
2272-
} else if (descriptor == &STRUCT_TYPE_DESCR_SYM(s10Dictionary)) {
2272+
} else if (descriptor == &NOMINAL_TYPE_DESCR_SYM(SD)) {
22732273
if (flags & DynamicCastFlags::Unconditional) {
22742274
_swift_dictionaryDownCastIndirect(source, destination,
22752275
sourceArgs[0], sourceArgs[1],
@@ -2285,7 +2285,7 @@ static bool _dynamicCastStructToStruct(OpaqueValue *destination,
22852285
}
22862286

22872287
// Sets.
2288-
} else if (descriptor == &STRUCT_TYPE_DESCR_SYM(s3Set)) {
2288+
} else if (descriptor == &NOMINAL_TYPE_DESCR_SYM(Sh)) {
22892289
if (flags & DynamicCastFlags::Unconditional) {
22902290
_swift_setDownCastIndirect(source, destination,
22912291
sourceArgs[0], targetArgs[0],

stdlib/public/runtime/SwiftHashableSupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
namespace swift {
2020
namespace hashable_support {
2121

22-
extern "C" const ProtocolDescriptor PROTOCOL_DESCR_SYM(s8Hashable);
23-
static constexpr auto &HashableProtocolDescriptor = PROTOCOL_DESCR_SYM(s8Hashable);
22+
extern "C" const ProtocolDescriptor PROTOCOL_DESCR_SYM(SH);
23+
static constexpr auto &HashableProtocolDescriptor = PROTOCOL_DESCR_SYM(SH);
2424

2525
struct HashableWitnessTable;
2626

test/DebugInfo/mangling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ func markUsed<T>(_ t: T) {}
88
// Variable:
99
// mangling.myDict : Swift.Dictionary<Swift.Int64, Swift.String>
1010
// CHECK: !DIGlobalVariable(name: "myDict",
11-
// CHECK-SAME: linkageName: "$S8mangling6myDicts10DictionaryVys5Int64VSSGvp",
11+
// CHECK-SAME: linkageName: "$S8mangling6myDictSDys5Int64VSSGvp",
1212
// CHECK-SAME: line: [[@LINE+3]]
1313
// CHECK-SAME: type: ![[DT:[0-9]+]]
1414
// CHECK: ![[DT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Dictionary"

test/Demangle/Inputs/manglings.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ _TtSV ---> Swift.UnsafeRawPointer
2323
_TtSv ---> Swift.UnsafeMutableRawPointer
2424
_TtGSaSS_ ---> [Swift.String]
2525
_TtGSqSS_ ---> Swift.String?
26-
_TtGSQSS_ ---> Swift.String!
2726
_TtGVs10DictionarySSSi_ ---> [Swift.String : Swift.Int]
2827
_TtVs7CString ---> Swift.CString
2928
_TtCSo8NSObject ---> __C.NSObject
@@ -287,10 +286,6 @@ _T03nix6testitSaySiGyFTv_ ---> outlined variable #0 of nix.testit() -> [Swift.In
287286
_T03nix6testitSaySiGyFTv0_ ---> outlined variable #1 of nix.testit() -> [Swift.Int]
288287
_T0So11UITextFieldC4textSSSgvgToTepb_ ---> outlined bridged method (pb) of @objc __C.UITextField.text.getter : Swift.String?
289288
_T0So11UITextFieldC4textSSSgvgToTeab_ ---> outlined bridged method (ab) of @objc __C.UITextField.text.getter : Swift.String?
290-
_T0So5GizmoC11doSomethingSQyypGSQySaySSGGFToTembnn_ ---> outlined bridged method (mbnn) of @objc __C.Gizmo.doSomething([Swift.String]!) -> Any!
291-
_T0So5GizmoC12modifyStringSQySSGAD_Si10withNumberSQyypG0D6FoobartFToTembnnnb_ ---> outlined bridged method (mbnnnb) of @objc __C.Gizmo.modifyString(_: Swift.String!, withNumber: Swift.Int, withFoobar: Any!) -> Swift.String!
292-
_$SSo5GizmoC11doSomethingySQyypGSQySaySSGGFToTembnn_ ---> outlined bridged method (mbnn) of @objc __C.Gizmo.doSomething([Swift.String]!) -> Any!
293-
_$SSo5GizmoC12modifyString_10withNumber0D6FoobarSQySSGAF_SiSQyypGtFToTembnnnb_ ---> outlined bridged method (mbnnnb) of @objc __C.Gizmo.modifyString(_: Swift.String!, withNumber: Swift.Int, withFoobar: Any!) -> Swift.String!
294289
_T04test1SVyxGAA1RA2A1ZRzAA1Y2ZZRpzl1A_AhaGPWT ---> {C} associated type witness table accessor for A.ZZ : test.Y in <A where A: test.Z, A.ZZ: test.Y> test.S<A> : test.R in test
295290
_T0s24_UnicodeScalarExceptions33_0E4228093681F6920F0AB2E48B4F1C69LLVACycfC ---> Swift.(_UnicodeScalarExceptions in _0E4228093681F6920F0AB2E48B4F1C69).init() -> Swift.(_UnicodeScalarExceptions in _0E4228093681F6920F0AB2E48B4F1C69)
296291
_T0D ---> _T0D

test/IDE/reconstruct_type_from_mangled_name.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ struct HasGenericSubscript<T> {
327327
private
328328
// CHECK: decl: private func patatino<T>(_ vers1: T, _ vers2: T) -> Bool where T : Comparable for
329329
func patatino<T: Comparable>(_ vers1: T, _ vers2: T) -> Bool {
330-
// CHECK: decl: FAILURE for 'T' usr=s:14swift_ide_test8patatino33_D7B956AE2D93947DFA67A1ECF93EF238LLySbx_xts10ComparableRzlF1TL_xmfp decl
331-
// CHECK: decl: let vers1: T for 'vers1' usr=s:14swift_ide_test8patatino33_D7B956AE2D93947DFA67A1ECF93EF238LLySbx_xts10ComparableRzlF5vers1L_xvp
332-
// CHECK: decl: let vers2: T for 'vers2' usr=s:14swift_ide_test8patatino33_D7B956AE2D93947DFA67A1ECF93EF238LLySbx_xts10ComparableRzlF5vers2L_xvp
330+
// CHECK: decl: FAILURE for 'T' usr=s:14swift_ide_test8patatino33_D7B956AE2D93947DFA67A1ECF93EF238LLySbx_xtSLRzlF1TL_xmfp decl
331+
// CHECK: decl: let vers1: T for 'vers1' usr=s:14swift_ide_test8patatino33_D7B956AE2D93947DFA67A1ECF93EF238LLySbx_xtSLRzlF5vers1L_xvp
332+
// CHECK: decl: let vers2: T for 'vers2' usr=s:14swift_ide_test8patatino33_D7B956AE2D93947DFA67A1ECF93EF238LLySbx_xtSLRzlF5vers2L_xvp
333333
return vers1 < vers2;
334334
}

test/IRGen/big_types_corner_cases.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ public struct MUseStruct {
185185

186186
// CHECK-LABEL-64: define{{( protected)?}} swiftcc void @"$S22big_types_corner_cases18stringAndSubstringSS_s0G0VtyF"(<{ %TSS, %Ts9SubstringV }>* noalias nocapture sret) #0 {
187187
// CHECK-LABEL-32: define{{( protected)?}} swiftcc void @"$S22big_types_corner_cases18stringAndSubstringSS_s0G0VtyF"(<{ %TSS, [4 x i8], %Ts9SubstringV }>* noalias nocapture sret) #0 {
188-
// CHECK: alloca %Ts9SubstringV
189-
// CHECK: alloca %Ts9SubstringV
188+
// CHECK: alloca %TSs
189+
// CHECK: alloca %TSs
190190
// CHECK: ret void
191191
public func stringAndSubstring() -> (String, Substring) {
192192
let s = "Hello, World"
@@ -207,15 +207,15 @@ public func testGetFunc() {
207207
// CHECK-LABEL: define{{( protected)?}} hidden swiftcc void @"$S22big_types_corner_cases7TestBigC4testyyF"(%T22big_types_corner_cases7TestBigC* swiftself)
208208
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$SSayy22big_types_corner_cases9BigStructVcSgGMa"
209209
// CHECK: [[CALL1:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
210-
// CHECK: [[CALL2:%.*]] = call i8** @"$SSayy22big_types_corner_cases9BigStructVcSgGSayxGs10CollectionsWl
211-
// CHECK: call swiftcc void @"$Ss10CollectionPsE10firstIndex5where0C0QzSgSb7ElementQzKXE_tKF"(%TSq.{{.*}}* noalias nocapture sret {{.*}}, i8* bitcast (i1 (%T22big_types_corner_cases9BigStructVytIegnr_Sg*, %swift.refcounted*, %swift.error**)* @"$S22big_types_corner_cases9BigStructVIegy_SgSbs5Error_pIggdzo_ACytIegnr_SgSbsAE_pIegndzo_TRTA" to i8*), %swift.opaque* {{.*}}, %swift.type* [[CALL1]], i8** [[CALL2]], %swift.opaque* noalias nocapture swiftself
210+
// CHECK: [[CALL2:%.*]] = call i8** @"$SSayy22big_types_corner_cases9BigStructVcSgGSayxGSlsWl
211+
// CHECK: call swiftcc void @"$SSlsE10firstIndex5where0B0QzSgSb7ElementQzKXE_tKF"(%TSq.{{.*}}* noalias nocapture sret {{.*}}, i8* bitcast (i1 (%T22big_types_corner_cases9BigStructVytIegnr_Sg*, %swift.refcounted*, %swift.error**)* @"$S22big_types_corner_cases9BigStructVIegy_SgSbs5Error_pIggdzo_ACytIegnr_SgSbsAE_pIegndzo_TRTA" to i8*), %swift.opaque* {{.*}}, %swift.type* [[CALL1]], i8** [[CALL2]], %swift.opaque* noalias nocapture swiftself
212212
// CHECK: ret void
213213

214214
// CHECK-LABEL: define{{( protected)?}} hidden swiftcc void @"$S22big_types_corner_cases7TestBigC5test2yyF"(%T22big_types_corner_cases7TestBigC* swiftself)
215215
// CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$SSaySS2ID_y22big_types_corner_cases9BigStructVcSg7handlertGMa"
216216
// CHECK: [[CALL1:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
217-
// CHECK: [[CALL2:%.*]] = call i8** @"$SSaySS2ID_y22big_types_corner_cases9BigStructVcSg7handlertGSayxGs10CollectionsWl"
218-
// CHECK: call swiftcc void @"$Ss10CollectionPss16IndexingIteratorVyxG0C0RtzrlE04makeC0AEyF"(%Ts16IndexingIteratorV* noalias nocapture sret {{.*}}, %swift.type* [[CALL1]], i8** [[CALL2]], %swift.opaque* noalias nocapture swiftself {{.*}})
217+
// CHECK: [[CALL2:%.*]] = call i8** @"$SSaySS2ID_y22big_types_corner_cases9BigStructVcSg7handlertGSayxGSlsWl"
218+
// CHECK: call swiftcc void @"$SSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF"(%Ts16IndexingIteratorV* noalias nocapture sret {{.*}}, %swift.type* [[CALL1]], i8** [[CALL2]], %swift.opaque* noalias nocapture swiftself {{.*}})
219219
// CHECK: ret void
220220
class TestBig {
221221
typealias Handler = (BigStruct) -> Void

0 commit comments

Comments
 (0)