Skip to content

Commit 4cb1704

Browse files
committed
[nfc] Clang format the PR.
1 parent 6da5e7e commit 4cb1704

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,8 @@ ParameterList *ClangImporter::Implementation::importFunctionParameterList(
19931993
return nullptr;
19941994
} else if (isa<clang::ReferenceType>(paramTy) &&
19951995
isa<clang::TemplateTypeParmType>(paramTy->getPointeeType())) {
1996-
auto templateParamType = cast<clang::TemplateTypeParmType>(paramTy->getPointeeType());
1996+
auto templateParamType =
1997+
cast<clang::TemplateTypeParmType>(paramTy->getPointeeType());
19971998
swiftParamTy =
19981999
findGenericTypeInGenericDecls(templateParamType, genericParams);
19992000
isInOut = true;

lib/Sema/CSApply.cpp

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ Solution::resolveConcreteDeclRef(ValueDecl *decl,
231231
if (!newFn)
232232
return ConcreteDeclRef(decl);
233233

234-
auto newDecl = cast_or_null<ValueDecl>(decl->getASTContext().getClangModuleLoader()->importDeclDirectly(newFn));
234+
auto newDecl = cast_or_null<ValueDecl>(
235+
decl->getASTContext().getClangModuleLoader()->importDeclDirectly(
236+
newFn));
235237

236238
if (auto fn = dyn_cast<FuncDecl>(decl)) {
237239
if (newFn->getNumParams() != fn->getParameters()->size()) {
@@ -263,20 +265,26 @@ Solution::resolveConcreteDeclRef(ValueDecl *decl,
263265
!triple.isWindowsCygwinEnvironment() &&
264266
// Make sure we're substituting in at least one Int or UInt
265267
// (technically not necessary).
266-
llvm::any_of(subst.getReplacementTypes(),[](Type t) {
268+
llvm::any_of(subst.getReplacementTypes(), [](Type t) {
267269
return t->isEqual(t->getASTContext().getIntType()) ||
268270
t->isEqual(t->getASTContext().getUIntType());
269271
})) {
270-
auto originalFnSubst = cast<AbstractFunctionDecl>(decl)->getInterfaceType()->getAs<GenericFunctionType>()->substGenericArgs(subst);
271-
assert(fn->getParameters()->size() == originalFnSubst->getParams().size());
272+
auto originalFnSubst = cast<AbstractFunctionDecl>(decl)
273+
->getInterfaceType()
274+
->getAs<GenericFunctionType>()
275+
->substGenericArgs(subst);
276+
assert(fn->getParameters()->size() ==
277+
originalFnSubst->getParams().size());
272278
SmallVector<ParamDecl *, 4> fixedParameters;
273279
unsigned parameterIndex = 0;
274280
for (auto *newFnParam : *fn->getParameters()) {
275281
// If the user substituted this param with an (U)Int, use (U)Int.
276-
auto substParamType = originalFnSubst->getParams()[parameterIndex].getParameterType();
282+
auto substParamType =
283+
originalFnSubst->getParams()[parameterIndex].getParameterType();
277284
if (substParamType->isEqual(fn->getASTContext().getIntType()) ||
278285
substParamType->isEqual(fn->getASTContext().getUIntType())) {
279-
auto intParam = ParamDecl::cloneWithoutType(fn->getASTContext(), newFnParam);
286+
auto intParam =
287+
ParamDecl::cloneWithoutType(fn->getASTContext(), newFnParam);
280288
intParam->setInterfaceType(substParamType);
281289
fixedParameters.push_back(intParam);
282290
} else {
@@ -287,17 +295,21 @@ Solution::resolveConcreteDeclRef(ValueDecl *decl,
287295

288296
assert(fn->getParameters()->size() == fixedParameters.size());
289297

290-
auto fixedParams = ParameterList::create(fn->getASTContext(), fixedParameters);
298+
auto fixedParams =
299+
ParameterList::create(fn->getASTContext(), fixedParameters);
291300
fn->setParameters(fixedParams);
292301

293302
// Now fix the result type:
294-
if (originalFnSubst->getResult()->isEqual(fn->getASTContext().getIntType()) ||
295-
originalFnSubst->getResult()->isEqual(fn->getASTContext().getUIntType())) {
303+
if (originalFnSubst->getResult()->isEqual(
304+
fn->getASTContext().getIntType()) ||
305+
originalFnSubst->getResult()->isEqual(
306+
fn->getASTContext().getUIntType())) {
296307
// Constructors don't have a result.
297308
if (auto func = dyn_cast<FuncDecl>(fn)) {
298309
newDecl = FuncDecl::createImplicit(
299-
func->getASTContext(), func->getStaticSpelling(), func->getName(),
300-
func->getNameLoc(), func->hasAsync(), func->hasThrows(),
310+
func->getASTContext(), func->getStaticSpelling(),
311+
func->getName(), func->getNameLoc(), func->hasAsync(),
312+
func->hasThrows(),
301313
/*genericParams=*/nullptr, fixedParams,
302314
originalFnSubst->getResult(), func->getDeclContext());
303315
}

0 commit comments

Comments
 (0)