AST: Rename old form of {Generic,}FunctionType::get() to getOld()

This makes it easier to grep for and eventually remove the
remaining usages.

It also allows you to write FunctionType::get({}, ...) to call the
ArrayRef overload empty parameter list, instead of picking the Type
overload and calling it with an empty Type() value.

While I"m at it, in a few places instead of renaming just clean up
usages where it was completely mechanical to do so.
This commit is contained in:
Slava Pestov
2018-08-16 00:35:17 -07:00
parent a54251074c
commit 527ff375dc
28 changed files with 237 additions and 225 deletions

View File

@@ -1131,7 +1131,7 @@ namespace {
// Add the member constraint for a subscript declaration.
// FIXME: weak name!
auto fnTy = FunctionType::get(inputTv, outputTy);
auto fnTy = FunctionType::getOld(inputTv, outputTy);
// FIXME: synthesizeMaterializeForSet() wants to statically dispatch to
// a known subscript here. This might be cleaner if we split off a new
@@ -1528,7 +1528,7 @@ namespace {
CS.getConstraintLocator(expr, ConstraintLocator::RValueAdjustment));
// The function/enum case must be callable with the given argument.
auto funcTy = FunctionType::get(CS.getType(arg), outputTy);
auto funcTy = FunctionType::getOld(CS.getType(arg), outputTy);
CS.addConstraint(ConstraintKind::ApplicableFunction, funcTy,
memberTy,
CS.getConstraintLocator(expr, ConstraintLocator::ApplyFunction));
@@ -1578,7 +1578,7 @@ namespace {
TVO_CanBindToLValue |
TVO_PrefersSubtypeBinding);
auto resultTy = CS.createTypeVariable(CS.getConstraintLocator(expr));
auto methodTy = FunctionType::get(argsTy, resultTy);
auto methodTy = FunctionType::getOld(argsTy, resultTy);
CS.addValueMemberConstraint(
baseTy, expr->getName(), methodTy, CurDC,
expr->getFunctionRefKind(),
@@ -2503,8 +2503,8 @@ namespace {
if (isa<ClosureExpr>(fnExpr->getSemanticsProvidingExpr()))
extInfo = extInfo.withNoEscape();
auto funcTy = FunctionType::get(CS.getType(expr->getArg()), outputTy,
extInfo);
auto funcTy = FunctionType::getOld(CS.getType(expr->getArg()), outputTy,
extInfo);
CS.addConstraint(ConstraintKind::ApplicableFunction, funcTy,
CS.getType(expr->getFn()),