Skip to content

Remove ImportHintKind::Reference #10807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions lib/ClangImporter/ImportType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ namespace {
/// The source type is a CF object pointer type.
CFPointer,

/// The source type is a C++ reference type.
Reference,

/// The source type is a block pointer type.
Block,

Expand Down Expand Up @@ -123,7 +120,6 @@ namespace {
case ImportHint::BOOL:
case ImportHint::Boolean:
case ImportHint::NSUInteger:
case ImportHint::Reference:
case ImportHint::Void:
return false;

Expand Down Expand Up @@ -420,7 +416,7 @@ namespace {
}

ImportResult VisitReferenceType(const clang::ReferenceType *type) {
return { nullptr, ImportHint::Reference };
return Type();
}

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

// Reference types are only permitted as function parameter types.
if (hint == ImportHint::Reference &&
importKind == ImportTypeKind::Parameter) {
auto refType = clangType->castAs<clang::ReferenceType>();
// Import the underlying type.
auto objectType = impl.importType(refType->getPointeeType(),
ImportTypeKind::Pointee,
allowNSUIntegerAsInt,
canFullyBridgeTypes);
if (!objectType)
return nullptr;

return InOutType::get(objectType);
}

// For anything else, if we completely failed to import the type
// abstractly, give up now.
if (!importedType)
Expand Down