Skip to content

Commit 0392181

Browse files
authored
Merge pull request swiftlang#39653 from NuriAmari/auto
NFC: Remove Decl* declarations made using auto
2 parents 865b782 + 03d4d11 commit 0392181

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2883,7 +2883,7 @@ void ClangImporter::lookupTypeDecl(
28832883
!isa<clang::ObjCCompatibleAliasDecl>(clangDecl)) {
28842884
continue;
28852885
}
2886-
auto *imported = Impl.importDecl(clangDecl, Impl.CurrentVersion);
2886+
Decl *imported = Impl.importDecl(clangDecl, Impl.CurrentVersion);
28872887

28882888
// Namespaces are imported as extensions for enums.
28892889
if (auto ext = dyn_cast_or_null<ExtensionDecl>(imported)) {
@@ -3015,7 +3015,7 @@ void ClangModuleUnit::getTopLevelDecls(SmallVectorImpl<Decl*> &results) const {
30153015
llvm::SmallPtrSet<ExtensionDecl *, 8> knownExtensions;
30163016
for (auto entry : lookupTable->allGlobalsAsMembers()) {
30173017
auto decl = entry.get<clang::NamedDecl *>();
3018-
auto importedDecl = owner.importDecl(decl, owner.CurrentVersion);
3018+
Decl *importedDecl = owner.importDecl(decl, owner.CurrentVersion);
30193019
if (!importedDecl) continue;
30203020

30213021
// Find the enclosing extension, if there is one.
@@ -3381,9 +3381,7 @@ void ClangModuleUnit::lookupObjCMethods(
33813381
if (objcMethod->isPropertyAccessor())
33823382
(void)owner.importDecl(objcMethod->findPropertyDecl(true),
33833383
owner.CurrentVersion);
3384-
3385-
auto imported =
3386-
owner.importDecl(objcMethod, owner.CurrentVersion);
3384+
Decl *imported = owner.importDecl(objcMethod, owner.CurrentVersion);
33873385
if (!imported) continue;
33883386

33893387
if (auto func = dyn_cast<AbstractFunctionDecl>(imported))

lib/ClangImporter/ImportDecl.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,8 +2486,8 @@ namespace {
24862486
// that we add this to the parent enum (in the "__ObjC" module) and not
24872487
// to the extension.
24882488
auto parentNS = cast<clang::NamespaceDecl>(decl->getParent());
2489-
auto parent =
2490-
Impl.importDecl(parentNS, getVersion(), /*UseCanonicalDecl*/ false);
2489+
Decl *parent = Impl.importDecl(parentNS, getVersion(),
2490+
/*UseCanonicalDecl*/ false);
24912491
// Sometimes when the parent namespace is imported, this namespace
24922492
// also gets imported. If that's the case, then the parent namespace
24932493
// will be an enum (because it was able to be fully imported) in which
@@ -3590,7 +3590,7 @@ namespace {
35903590
}
35913591
}
35923592

3593-
auto member = Impl.importDecl(nd, getActiveSwiftVersion());
3593+
Decl *member = Impl.importDecl(nd, getActiveSwiftVersion());
35943594
if (!member) {
35953595
if (!isa<clang::TypeDecl>(nd) && !isa<clang::FunctionDecl>(nd)) {
35963596
// We don't know what this member is.
@@ -5938,8 +5938,7 @@ namespace {
59385938
auto name = importedName.getDeclName().getBaseIdentifier();
59395939

59405940
if (name.empty()) return nullptr;
5941-
5942-
auto importedDecl =
5941+
Decl *importedDecl =
59435942
Impl.importDecl(decl->getClassInterface(), getActiveSwiftVersion());
59445943
auto typeDecl = dyn_cast_or_null<TypeDecl>(importedDecl);
59455944
if (!typeDecl) return nullptr;
@@ -9990,7 +9989,7 @@ bool ClangImporter::Implementation::addMemberAndAlternatesToExtension(
99909989
return true;
99919990

99929991
// Then try to import the decl under the specified name.
9993-
auto *member = importDecl(decl, nameVersion);
9992+
Decl *member = importDecl(decl, nameVersion);
99949993
if (!member)
99959994
return false;
99969995

0 commit comments

Comments
 (0)