Skip to content

Commit a57ea86

Browse files
committed
AST: Invent a mangling for Builtin.TheTupleType to appease incremental dependency tracking
1 parent 217c4a5 commit a57ea86

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,16 +1324,14 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
13241324
return appendType(ET->getConstraintType(), sig, forDecl);
13251325
}
13261326

1327-
case TypeKind::BuiltinTuple:
1328-
llvm_unreachable("Not implemented");
1329-
13301327
case TypeKind::UnboundGeneric:
13311328
case TypeKind::Class:
13321329
case TypeKind::Enum:
13331330
case TypeKind::Struct:
13341331
case TypeKind::BoundGenericClass:
13351332
case TypeKind::BoundGenericEnum:
1336-
case TypeKind::BoundGenericStruct: {
1333+
case TypeKind::BoundGenericStruct:
1334+
case TypeKind::BuiltinTuple: {
13371335
GenericTypeDecl *Decl;
13381336
if (auto typeAlias = dyn_cast<TypeAliasType>(type.getPointer()))
13391337
Decl = typeAlias->getDecl();
@@ -2476,6 +2474,9 @@ void ASTMangler::appendAnyGenericType(const GenericTypeDecl *decl) {
24762474
return;
24772475
}
24782476

2477+
if (nominal && isa<BuiltinTupleDecl>(nominal))
2478+
return appendOperator("BT");
2479+
24792480
appendContextOf(decl);
24802481

24812482
// Always use Clang names for imported Clang declarations, unless they don't
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -typecheck -primary-file %s -emit-reference-dependencies-path %t/tuple-members.swiftdeps
3+
4+
func f() {}
5+
func f() -> S {}
6+
7+
struct S {
8+
var x: Int
9+
}
10+
11+
_ = f().x

0 commit comments

Comments
 (0)