Skip to content

Commit 1c1b0a2

Browse files
zhuoweiMaxDesiatov
authored andcommitted
Revert "WebAssembly: add a ton of logging when looking up metadata"
Don't need logging anymore. This reverts commit 065ab6f61c80c2573d72e1572c751914d42f7a61.
1 parent 7ecc42f commit 1c1b0a2

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
@@ -333,47 +333,19 @@ _findExtendedTypeContextDescriptor(const ContextDescriptor *maybeExtension,
333333
/// buildContextDescriptorMangling in MetadataReader.
334334
bool swift::_isCImportedTagType(const TypeContextDescriptor *type,
335335
const ParsedTypeIdentity &identity) {
336-
fprintf(stderr, "trying to dump type %p\n", type);
337-
fprintf(stderr, "name: %s\n", type->Name.get());
338-
fprintf(stderr, "trying to dump identity %p\n", &identity);
339-
fprintf(stderr, "User facing name: %s\n", identity.UserFacingName.str().c_str());
340-
fprintf(stderr, "ok, let's go\n");
341336
// Tag types are always imported as structs or enums.
342337
if (type->getKind() != ContextDescriptorKind::Enum &&
343338
type->getKind() != ContextDescriptorKind::Struct)
344339
return false;
345340

346-
fprintf(stderr, "is it a c typedef\n");
347-
348341
// Not a typedef imported as a nominal type.
349342
if (identity.isCTypedef())
350343
return false;
351344

352-
fprintf(stderr, "is related entity\n");
353-
354345
// Not a related entity.
355346
if (identity.isAnyRelatedEntity())
356347
return false;
357348

358-
fprintf(stderr, "is c imported context\n");
359-
fprintf(stderr, "type's parent, raw: %x\n", *((unsigned int*)&type->Parent));
360-
fprintf(stderr, "type's parent: %p\n", type->Parent.get());
361-
// fprintf(stderr, "type's parent name: %s\n", type->Parent->Name.get());
362-
fprintf(stderr, "trying to get module context\n");
363-
364-
for (auto cur = type->Parent.get(); true; cur = cur->Parent.get()) {
365-
fprintf(stderr, "cur %p\n", cur);
366-
fprintf(stderr, "cur %x\n", (unsigned int)cur->getKind());
367-
if (auto module = dyn_cast<ModuleContextDescriptor>(cur)) {
368-
fprintf(stderr, "found\n");
369-
break;
370-
}
371-
}
372-
373-
fprintf(stderr, "type's parent module context: %p\n", type->Parent->getModuleContext());
374-
fprintf(stderr, "trying to get name\n");
375-
fprintf(stderr, "type's parent module context name: %s\n", type->Parent->getModuleContext()->Name.get());
376-
377349
// Imported from C.
378350
return type->Parent->isCImportedContext();
379351
}

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)