Skip to content

Commit 6475fc7

Browse files
committed
Remove ImportHintKind::Reference
The only place in the Clang Importer that needs to deal with anything related to C++, and it doesn't actually do anything. Remove the import hint and the last place where the importer creates InOutTypes as well.
1 parent 0957ca6 commit 6475fc7

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ namespace {
7878
/// The source type is a CF object pointer type.
7979
CFPointer,
8080

81-
/// The source type is a C++ reference type.
82-
Reference,
83-
8481
/// The source type is a block pointer type.
8582
Block,
8683

@@ -123,7 +120,6 @@ namespace {
123120
case ImportHint::BOOL:
124121
case ImportHint::Boolean:
125122
case ImportHint::NSUInteger:
126-
case ImportHint::Reference:
127123
case ImportHint::Void:
128124
return false;
129125

@@ -420,7 +416,7 @@ namespace {
420416
}
421417

422418
ImportResult VisitReferenceType(const clang::ReferenceType *type) {
423-
return { nullptr, ImportHint::Reference };
419+
return Type();
424420
}
425421

426422
ImportResult VisitMemberPointer(const clang::MemberPointerType *type) {
@@ -1171,21 +1167,6 @@ static Type adjustTypeForConcreteImport(ClangImporter::Implementation &impl,
11711167
return hint.BridgedType;
11721168
}
11731169

1174-
// Reference types are only permitted as function parameter types.
1175-
if (hint == ImportHint::Reference &&
1176-
importKind == ImportTypeKind::Parameter) {
1177-
auto refType = clangType->castAs<clang::ReferenceType>();
1178-
// Import the underlying type.
1179-
auto objectType = impl.importType(refType->getPointeeType(),
1180-
ImportTypeKind::Pointee,
1181-
allowNSUIntegerAsInt,
1182-
canFullyBridgeTypes);
1183-
if (!objectType)
1184-
return nullptr;
1185-
1186-
return InOutType::get(objectType);
1187-
}
1188-
11891170
// For anything else, if we completely failed to import the type
11901171
// abstractly, give up now.
11911172
if (!importedType)

0 commit comments

Comments
 (0)