Skip to content

Commit 7399c20

Browse files
committed
[cxx-interop] Revert changes to ClangTypeConverter::visitMetatypeType.
The old implementation should be sufficient. The C++ constructors we import should get their types from the imported decl, not a double conversion to a SILFunction type and then back again.
1 parent 2713edb commit 7399c20

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/AST/ClangTypeConverter.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,19 +461,7 @@ clang::QualType ClangTypeConverter::visitProtocolType(ProtocolType *type) {
461461
// Metatypes can be converted to Class when they are metatypes for concrete
462462
// classes. https://github.com/apple/swift/pull/27479#discussion_r344418131
463463
clang::QualType ClangTypeConverter::visitMetatypeType(MetatypeType *type) {
464-
assert(type->hasRepresentation() &&
465-
"metatype should have been assigned a representation");
466-
switch (type->getRepresentation()) {
467-
case MetatypeRepresentation::Thin:
468-
return ClangASTContext.VoidTy;
469-
470-
case MetatypeRepresentation::Thick:
471-
llvm_unreachable("thick metatypes don't have a corresponding Clang type");
472-
473-
case MetatypeRepresentation::ObjC:
474-
return getClangMetatypeType(ClangASTContext);
475-
}
476-
llvm_unreachable("bad representation");
464+
return getClangMetatypeType(ClangASTContext);
477465
}
478466

479467
// TODO: [stronger-checking-in-clang-type-conversion]

0 commit comments

Comments
 (0)