Skip to content

Commit 1c42ee2

Browse files
committed
[ClangImporter] Replace getInput() with getParams().
1 parent 6b56154 commit 1c42ee2

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -6110,7 +6110,7 @@ ConstructorDecl *SwiftDeclConverter::importConstructor(
61106110

61116111
// Look for other imported constructors that occur in this context with
61126112
// the same name.
6113-
Type allocParamType = oldFnType->getInput();
6113+
auto allocParams = oldFnType->getParams();
61146114
bool ignoreNewExtensions = isa<ClassDecl>(dc);
61156115
for (auto other : ownerNominal->lookupDirect(importedName.getDeclName(),
61166116
ignoreNewExtensions)) {
@@ -6127,12 +6127,12 @@ ConstructorDecl *SwiftDeclConverter::importConstructor(
61276127
// If the types don't match, this is a different constructor with
61286128
// the same selector. This can happen when an overlay overloads an
61296129
// existing selector with a Swift-only signature.
6130-
Type ctorParamType = ctor->getInterfaceType()
6131-
->castTo<AnyFunctionType>()
6132-
->getResult()
6133-
->castTo<AnyFunctionType>()
6134-
->getInput();
6135-
if (!ctorParamType->isEqual(allocParamType)) {
6130+
auto ctorParams = ctor->getInterfaceType()
6131+
->castTo<AnyFunctionType>()
6132+
->getResult()
6133+
->castTo<AnyFunctionType>()
6134+
->getParams();
6135+
if (!AnyFunctionType::equalParams(ctorParams, allocParams)) {
61366136
continue;
61376137
}
61386138

lib/ClangImporter/ImportType.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -407,8 +407,9 @@ namespace {
407407
FunctionType *fTy = pointeeType->castTo<FunctionType>();
408408

409409
auto rep = FunctionType::Representation::Block;
410-
auto funcTy = FunctionType::get(fTy->getInput(), fTy->getResult(),
411-
fTy->getExtInfo().withRepresentation(rep));
410+
auto funcTy =
411+
FunctionType::get(fTy->getParams(), fTy->getResult(),
412+
fTy->getExtInfo().withRepresentation(rep));
412413
return { funcTy, ImportHint::Block };
413414
}
414415

@@ -1537,7 +1538,7 @@ static Type applyNoEscape(Type type) {
15371538

15381539
// Apply @noescape to function types.
15391540
if (auto funcType = type->getAs<FunctionType>()) {
1540-
return FunctionType::get(funcType->getInput(), funcType->getResult(),
1541+
return FunctionType::get(funcType->getParams(), funcType->getResult(),
15411542
funcType->getExtInfo().withNoEscape());
15421543
}
15431544

0 commit comments

Comments
 (0)