Skip to content

Commit cae9072

Browse files
authored
Merge pull request #15404 from eeckstein/fix-bca-2
2 parents a901bd7 + 5ce29cb commit cae9072

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ void CalleeCache::computeWitnessMethodCalleesForWitnessTable(
161161
canCallUnknown = true;
162162
break;
163163
case AccessLevel::Internal:
164-
canCallUnknown = !M.isWholeModule();
165-
break;
164+
if (!M.isWholeModule()) {
165+
canCallUnknown = true;
166+
break;
167+
}
168+
LLVM_FALLTHROUGH;
166169
case AccessLevel::FilePrivate:
167170
case AccessLevel::Private: {
168171
auto Witness = Conf->getWitness(Requirement.getDecl(), nullptr);

test/SILOptimizer/basic-callee-printer.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ struct SingleConformance : PublicProtocol {
677677

678678
public func testit(p: PublicProtocol)
679679

680-
sil private [transparent] [thunk] @$foo_impl : $@convention(witness_method: PublicProtocol) (@in_guaranteed SingleConformance) -> () {
680+
sil private [transparent] [thunk] @foo_impl : $@convention(witness_method: PublicProtocol) (@in_guaranteed SingleConformance) -> () {
681681
bb0(%0 : $*SingleConformance):
682682
%4 = tuple ()
683683
return %4 : $()
@@ -689,7 +689,7 @@ bb0(%0 : $*SingleConformance):
689689
// CHECK-NOWMO: Incomplete callee list? : Yes
690690
// CHECK-WMO: Incomplete callee list? : Yes
691691
// CHECK: Known callees:
692-
sil @$call_foo : $@convention(thin) (@in PublicProtocol) -> () {
692+
sil @call_foo : $@convention(thin) (@in PublicProtocol) -> () {
693693
bb0(%0 : $*PublicProtocol):
694694
%5 = open_existential_addr immutable_access %0 : $*PublicProtocol to $*@opened("2226A1AC-2B95-11E8-BDF4-D0817AD3F637") PublicProtocol
695695
%6 = witness_method $@opened("2226A1AC-2B95-11E8-BDF4-D0817AD3F637") PublicProtocol, #PublicProtocol.foo!1 : <Self where Self : PublicProtocol> (Self) -> () -> (), %5 : $*@opened("2226A1AC-2B95-11E8-BDF4-D0817AD3F637") PublicProtocol : $@convention(witness_method: PublicProtocol) <τ_0_0 where τ_0_0 : PublicProtocol> (@in_guaranteed τ_0_0) -> ()
@@ -700,6 +700,6 @@ bb0(%0 : $*PublicProtocol):
700700
}
701701

702702
sil_witness_table hidden SingleConformance: PublicProtocol module nix {
703-
method #PublicProtocol.foo!1: <Self where Self : PublicProtocol> (Self) -> () -> () : @$foo_impl
703+
method #PublicProtocol.foo!1: <Self where Self : PublicProtocol> (Self) -> () -> () : @foo_impl
704704
}
705705

0 commit comments

Comments
 (0)