Skip to content

Commit 2406043

Browse files
zhuoweikateinoigakukun
authored andcommitted
Revert "WebAssembly: add a ton of logging when looking up metadata"
Don't need logging anymore. This reverts commit 065ab6f61c80c2573d72e1572c751914d42f7a61.
1 parent 1843a87 commit 2406043

File tree

2 files changed

+2
-48
lines changed

2 files changed

+2
-48
lines changed

stdlib/public/runtime/MetadataLookup.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -299,47 +299,19 @@ _findExtendedTypeContextDescriptor(const ContextDescriptor *maybeExtension,
299299
/// buildContextDescriptorMangling in MetadataReader.
300300
bool swift::_isCImportedTagType(const TypeContextDescriptor *type,
301301
const ParsedTypeIdentity &identity) {
302-
fprintf(stderr, "trying to dump type %p\n", type);
303-
fprintf(stderr, "name: %s\n", type->Name.get());
304-
fprintf(stderr, "trying to dump identity %p\n", &identity);
305-
fprintf(stderr, "User facing name: %s\n", identity.UserFacingName.str().c_str());
306-
fprintf(stderr, "ok, let's go\n");
307302
// Tag types are always imported as structs or enums.
308303
if (type->getKind() != ContextDescriptorKind::Enum &&
309304
type->getKind() != ContextDescriptorKind::Struct)
310305
return false;
311306

312-
fprintf(stderr, "is it a c typedef\n");
313-
314307
// Not a typedef imported as a nominal type.
315308
if (identity.isCTypedef())
316309
return false;
317310

318-
fprintf(stderr, "is related entity\n");
319-
320311
// Not a related entity.
321312
if (identity.isAnyRelatedEntity())
322313
return false;
323314

324-
fprintf(stderr, "is c imported context\n");
325-
fprintf(stderr, "type's parent, raw: %x\n", *((unsigned int*)&type->Parent));
326-
fprintf(stderr, "type's parent: %p\n", type->Parent.get());
327-
// fprintf(stderr, "type's parent name: %s\n", type->Parent->Name.get());
328-
fprintf(stderr, "trying to get module context\n");
329-
330-
for (auto cur = type->Parent.get(); true; cur = cur->Parent.get()) {
331-
fprintf(stderr, "cur %p\n", cur);
332-
fprintf(stderr, "cur %x\n", (unsigned int)cur->getKind());
333-
if (auto module = dyn_cast<ModuleContextDescriptor>(cur)) {
334-
fprintf(stderr, "found\n");
335-
break;
336-
}
337-
}
338-
339-
fprintf(stderr, "type's parent module context: %p\n", type->Parent->getModuleContext());
340-
fprintf(stderr, "trying to get name\n");
341-
fprintf(stderr, "type's parent module context name: %s\n", type->Parent->getModuleContext()->Name.get());
342-
343315
// Imported from C.
344316
return type->Parent->isCImportedContext();
345317
}

stdlib/public/runtime/ProtocolConformance.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ static const ProtocolConformanceDescriptor *
553553
swift_conformsToSwiftProtocolImpl(const Metadata * const type,
554554
const ProtocolDescriptor *protocol,
555555
StringRef module) {
556-
fprintf(stderr, "in impl2\n");
557556
auto &C = Conformances.get();
558557

559558
// See if we have a cached conformance. The ConcurrentMap data structure
@@ -580,25 +579,17 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
580579
C.cacheFailure(type, protocol, snapshot.count());
581580
return nullptr;
582581
}
583-
fprintf(stderr, "got to really scan\n");
582+
584583
// Really scan conformance records.
585584
for (size_t i = startIndex; i < endIndex; i++) {
586-
fprintf(stderr, "index = %lx\n", (unsigned long)i);
587585
auto &section = snapshot.Start[i];
588586
// Eagerly pull records for nondependent witnesses into our cache.
589587
for (const auto &record : section) {
590-
fprintf(stderr, "got a record\n");
591-
auto descriptorPtr = record.get();
592-
auto &descriptor = *descriptorPtr;
593-
fprintf(stderr, "got the descriptor: %p\n", descriptorPtr);
594-
fprintf(stderr, "got the protocol: %p\n", descriptor.getProtocol());
595-
descriptor.getProtocol()->dump();
596-
fprintf(stderr, "got it\n");
588+
auto &descriptor = *record.get();
597589

598590
// We only care about conformances for this protocol.
599591
if (descriptor.getProtocol() != protocol)
600592
continue;
601-
fprintf(stderr, "about to get matching type\n");
602593

603594
// If there's a matching type, record the positive result.
604595
ConformanceCandidate candidate(descriptor);
@@ -613,7 +604,6 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
613604
}
614605

615606
// Conformance scan is complete.
616-
fprintf(stderr, "about to update cache\n");
617607

618608
// Search the cache once more, and this time update the cache if necessary.
619609
FoundConformance = searchInConformanceCache(type, protocol);
@@ -628,18 +618,10 @@ swift_conformsToSwiftProtocolImpl(const Metadata * const type,
628618
static const WitnessTable *
629619
swift_conformsToProtocolImpl(const Metadata * const type,
630620
const ProtocolDescriptor *protocol) {
631-
// WebAssembly: logging pls
632-
fprintf(stderr, "swift_conformsToProtocolImpl: %p %p\n", type, protocol);
633-
protocol->dump();
634-
fprintf(stderr, "trying to dump the type now\n");
635-
type->dump();
636-
fprintf(stderr, "dumped the type\n");
637-
// end WebAssembly
638621
auto description =
639622
swift_conformsToSwiftProtocol(type, protocol, StringRef());
640623
if (!description)
641624
return nullptr;
642-
description->getProtocol()->dump();
643625

644626
return description->getWitnessTable(
645627
findConformingSuperclass(type, description));

0 commit comments

Comments
 (0)