Skip to content

Commit 88957b7

Browse files
committed
hmm x2
1 parent 464fa82 commit 88957b7

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/ClangImporter/ClangDerivedConformances.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ void swift::conformToCxxIteratorIfNeeded(
638638
auto distanceTy = minus->getResultInterfaceType();
639639
// distanceTy conforms to BinaryInteger, this is ensured by getMinusOperator.
640640

641+
if (clangDecl->getIdentifier() &&
642+
clangDecl->getName() == "__normal_iterator") {
643+
llvm::errs() << "//// conforming __normal_iterator to UnsafeCxxIter: done minus\n";
644+
}
641645
auto plusEqual = getPlusEqualOperator(decl, distanceTy);
642646
if (!plusEqual) {
643647
clang::FunctionDecl *instantiated = instantiateTemplatedOperator(
@@ -658,6 +662,10 @@ void swift::conformToCxxIteratorIfNeeded(
658662
}
659663
if (!plusEqual)
660664
return;
665+
if (clangDecl->getIdentifier() &&
666+
clangDecl->getName() == "__normal_iterator") {
667+
llvm::errs() << "//// conforming __normal_iterator to UnsafeCxxIter: done plusEqual\n";
668+
}
661669

662670
impl.addSynthesizedTypealias(decl, ctx.getIdentifier("Distance"), distanceTy);
663671
if (pointeeSettable)
@@ -1133,8 +1141,11 @@ void swift::conformToCxxVectorIfNeeded(ClangImporter::Implementation &impl,
11331141
auto rawIteratorTy = iterType->getUnderlyingType();
11341142

11351143
// Check if RawIterator conforms to UnsafeCxxRandomAccessIterator.
1136-
if (!checkConformance(rawIteratorTy, cxxRandomAccessIteratorProto))
1144+
if (!checkConformance(rawIteratorTy, cxxRandomAccessIteratorProto)) {
1145+
llvm::errs() << "!!! !!! !!! RawIterator does not conform:\n";
1146+
rawIteratorTy->getAnyNominal()->dump(llvm::errs());
11371147
return;
1148+
}
11381149

11391150
impl.addSynthesizedTypealias(decl, ctx.Id_Element,
11401151
valueType->getUnderlyingType());

lib/ClangImporter/ImportDecl.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,6 +2545,10 @@ namespace {
25452545
}
25462546
}
25472547

2548+
if (decl->getIdentifier() &&
2549+
decl->getName() == "__normal_iterator") {
2550+
llvm::errs() << "//// IMPORTED __normal_iterator\n";
2551+
}
25482552
result->setMemberLoader(&Impl, 0);
25492553
return result;
25502554
}
@@ -2888,6 +2892,7 @@ namespace {
28882892
auto result = VisitRecordDecl(decl);
28892893
if (!result)
28902894
return nullptr;
2895+
Impl.ImportedDecls[{decl, getVersion()}] = result;
28912896

28922897
if (decl->hasAttr<clang::TrivialABIAttr>()) {
28932898
// We cannot yet represent trivial_abi C++ records in Swift.
@@ -2939,6 +2944,12 @@ namespace {
29392944

29402945
if (auto *ntd = dyn_cast<NominalTypeDecl>(result))
29412946
addExplicitProtocolConformances(ntd, decl);
2947+
2948+
if (decl->getIdentifier() && decl->isInStdNamespace() &&
2949+
decl->getName() == "vector") {
2950+
llvm::errs() << "//// IMPORTED vector\n";
2951+
decl->dump(llvm::errs());
2952+
}
29422953

29432954
return result;
29442955
}

0 commit comments

Comments
 (0)