@@ -545,6 +545,7 @@ static const ProtocolConformanceDescriptor *
545
545
swift_conformsToSwiftProtocolImpl (const Metadata * const type,
546
546
const ProtocolDescriptor *protocol,
547
547
StringRef module) {
548
+ fprintf (stderr, " in impl2\n " );
548
549
auto &C = Conformances.get ();
549
550
550
551
// See if we have a cached conformance. The ConcurrentMap data structure
@@ -571,17 +572,25 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
571
572
C.cacheFailure (type, protocol, snapshot.count ());
572
573
return nullptr ;
573
574
}
574
-
575
+ fprintf (stderr, " got to really scan \n " );
575
576
// Really scan conformance records.
576
577
for (size_t i = startIndex; i < endIndex; i++) {
578
+ fprintf (stderr, " index = %lx\n " , (unsigned long )i);
577
579
auto §ion = snapshot.Start [i];
578
580
// Eagerly pull records for nondependent witnesses into our cache.
579
581
for (const auto &record : section) {
580
- auto &descriptor = *record.get ();
582
+ fprintf (stderr, " got a record\n " );
583
+ auto descriptorPtr = record.get ();
584
+ auto &descriptor = *descriptorPtr;
585
+ fprintf (stderr, " got the descriptor: %p\n " , descriptorPtr);
586
+ fprintf (stderr, " got the protocol: %p\n " , descriptor.getProtocol ());
587
+ descriptor.getProtocol ()->dump ();
588
+ fprintf (stderr, " got it\n " );
581
589
582
590
// We only care about conformances for this protocol.
583
591
if (descriptor.getProtocol () != protocol)
584
592
continue ;
593
+ fprintf (stderr, " about to get matching type\n " );
585
594
586
595
// If there's a matching type, record the positive result.
587
596
ConformanceCandidate candidate (descriptor);
@@ -596,6 +605,7 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
596
605
}
597
606
598
607
// Conformance scan is complete.
608
+ fprintf (stderr, " about to update cache\n " );
599
609
600
610
// Search the cache once more, and this time update the cache if necessary.
601
611
FoundConformance = searchInConformanceCache (type, protocol);
@@ -610,12 +620,21 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
610
620
static const WitnessTable *
611
621
swift_conformsToProtocolImpl (const Metadata * const type,
612
622
const ProtocolDescriptor *protocol) {
623
+ // WebAssembly: logging pls
624
+ fprintf (stderr, " swift_conformsToProtocolImpl: %p %p\n " , type, protocol);
625
+ protocol->dump ();
626
+ fprintf (stderr, " trying to dump the type now\n " );
627
+ type->dump ();
628
+ fprintf (stderr, " dumped the type\n " );
629
+ // end WebAssembly
613
630
auto description =
614
631
swift_conformsToSwiftProtocol (type, protocol, StringRef ());
615
632
if (!description)
616
633
return nullptr ;
634
+ description->getProtocol ()->dump ();
617
635
618
- return description->getWitnessTable (type);
636
+ auto retval = description->getWitnessTable (type);
637
+ return retval;
619
638
}
620
639
621
640
const ContextDescriptor *
0 commit comments