Skip to content

Commit f469928

Browse files
committed
[Type checker] Drop verbose conformance-access-path debugging dumps.
Under -debug-generic-signatures, we were computing and emitting conformance access paths for one test. Given that conformance access paths are used ubiquitously now, this test isn't providing any value (nor is the debug dump), stop dumpoing them.
1 parent da8ff3a commit f469928

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4159,30 +4159,6 @@ Optional<ProtocolConformanceRef> TypeChecker::conformsToProtocol(
41594159
}
41604160
}
41614161

4162-
// When requested, print the conformance access path used to find this
4163-
// conformance.
4164-
ASTContext &ctx = Proto->getASTContext();
4165-
if (ctx.LangOpts.DebugGenericSignatures &&
4166-
InExpression && T->is<ArchetypeType>() && lookupResult->isAbstract() &&
4167-
!T->castTo<ArchetypeType>()->isOpenedExistential() &&
4168-
!T->castTo<ArchetypeType>()->requiresClass() &&
4169-
T->castTo<ArchetypeType>()->getGenericEnvironment()
4170-
== DC->getGenericEnvironmentOfContext()) {
4171-
auto interfaceType = T->mapTypeOutOfContext();
4172-
if (interfaceType->isTypeParameter()) {
4173-
auto genericSig = DC->getGenericSignatureOfContext();
4174-
auto path = genericSig->getConformanceAccessPath(interfaceType, Proto);
4175-
4176-
// Debugging aid: display the conformance access path for archetype
4177-
// conformances.
4178-
llvm::errs() << "Conformance access path for ";
4179-
T.print(llvm::errs());
4180-
llvm::errs() << ": " << Proto->getName() << " is ";
4181-
path.print(llvm::errs());
4182-
llvm::errs() << "\n";
4183-
}
4184-
}
4185-
41864162
return lookupResult;
41874163
}
41884164

test/Generics/conformance_access_path.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// RUN: %target-typecheck-verify-swift -typecheck -swift-version 4 %s -verify
2-
// RUN: %target-typecheck-verify-swift -typecheck -swift-version 4 -debug-generic-signatures %s > %t.dump 2>&1
3-
// RUN: %FileCheck %s < %t.dump
42

53
protocol P0 { }
64
protocol Q0: P0 { }
@@ -37,22 +35,16 @@ func acceptP3<T: P3>(_: T) { }
3735

3836

3937
func testPaths1<T: P2 & P4>(_ t: T) {
40-
// CHECK: Conformance access path for T.AssocP2.AssocP1: P0 is τ_0_0: P2 -> τ_0_0.AssocP2: P1 -> τ_0_0.AssocP1: Q0 -> τ_0_0: P0
4138
acceptP0(t.getAssocP2().getAssocP1())
42-
// CHECK: Conformance access path for T.AssocP3: P0 is τ_0_0: P4 -> τ_0_0: P3 -> τ_0_0.AssocP3: P0
4339
acceptP0(t.getAssocP3())
4440
}
4541

4642
func testPaths2<U: P2 & P4>(_ t: U) where U.AssocP3 == U.AssocP2.AssocP1 {
47-
// CHECK: Conformance access path for U.AssocP3: P0 is τ_0_0: P4 -> τ_0_0: P3 -> τ_0_0.AssocP3: P0
4843
acceptP0(t.getAssocP2().getAssocP1())
4944
}
5045

5146
func testPaths3<V: P5>(_ v: V) {
52-
// CHECK: Conformance access path for V.AssocP3: P0 is τ_0_0: P5 -> τ_0_0.AssocP3: Q0 -> τ_0_0: P0
5347
acceptP0(v.getAssocP3())
54-
55-
// CHECK: Conformance access path for V.AssocP3: Q0 is τ_0_0: P5 -> τ_0_0.AssocP3: Q0
5648
acceptQ0(v.getAssocP3())
5749
}
5850

@@ -68,6 +60,5 @@ protocol P5Unordered {
6860
}
6961

7062
func testUnorderedP5_P6<W: P6Unordered>(_ w: W) {
71-
// CHECK: Conformance access path for W.A: P0 is τ_0_0: P6Unordered -> τ_0_0: P5Unordered -> τ_0_0.A: P0
7263
acceptP0(w.getA())
7364
}

0 commit comments

Comments
 (0)