Skip to content

Commit 07740a4

Browse files
authored
Merge pull request #5677 from milseman/import_name_cleanup
[Import Name] Cleanup some needless parameters
2 parents 982a57f + 3508e26 commit 07740a4

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

lib/ClangImporter/ImportName.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,10 @@ static StringRef determineSwiftNewtypeBaseName(StringRef baseName,
793793
return baseName;
794794
}
795795

796-
EffectiveClangContext NameImporter::determineEffectiveContext(
797-
const clang::NamedDecl *decl, const clang::DeclContext *dc,
798-
ImportNameOptions options, clang::Sema &clangSema) {
796+
EffectiveClangContext
797+
NameImporter::determineEffectiveContext(const clang::NamedDecl *decl,
798+
const clang::DeclContext *dc,
799+
ImportNameOptions options) {
799800
EffectiveClangContext res;
800801

801802
// Enumerators can end up within their enclosing enum or in the global
@@ -841,8 +842,7 @@ EffectiveClangContext NameImporter::determineEffectiveContext(
841842

842843
bool NameImporter::hasNamingConflict(const clang::NamedDecl *decl,
843844
const clang::IdentifierInfo *proposedName,
844-
const clang::TypedefNameDecl *cfTypedef,
845-
clang::Sema &clangSema) {
845+
const clang::TypedefNameDecl *cfTypedef) {
846846
// Test to see if there is a value with the same name as 'proposedName'
847847
// in the same module as the decl
848848
// FIXME: This will miss macros.
@@ -1101,7 +1101,7 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D,
11011101

11021102
// Compute the effective context.
11031103
auto dc = const_cast<clang::DeclContext *>(D->getDeclContext());
1104-
auto effectiveCtx = determineEffectiveContext(D, dc, options, clangSema);
1104+
auto effectiveCtx = determineEffectiveContext(D, dc, options);
11051105
if (!effectiveCtx)
11061106
return {};
11071107
result.EffectiveContext = effectiveCtx;
@@ -1455,8 +1455,7 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D,
14551455
SmallString<16> baseNameWithProtocolSuffix;
14561456
if (auto objcProto = dyn_cast<clang::ObjCProtocolDecl>(D)) {
14571457
if (objcProto->hasDefinition()) {
1458-
if (hasNamingConflict(D, objcProto->getIdentifier(), nullptr,
1459-
clangSema)) {
1458+
if (hasNamingConflict(D, objcProto->getIdentifier(), nullptr)) {
14601459
baseNameWithProtocolSuffix = baseName;
14611460
baseNameWithProtocolSuffix += SWIFT_PROTOCOL_SUFFIX;
14621461
baseName = baseNameWithProtocolSuffix;
@@ -1472,7 +1471,7 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D,
14721471
auto swiftName = getCFTypeName(typedefNameDecl);
14731472
if (!swiftName.empty() &&
14741473
!hasNamingConflict(D, &clangCtx.Idents.get(swiftName),
1475-
typedefNameDecl, clangSema)) {
1474+
typedefNameDecl)) {
14761475
// Adopt the requested name.
14771476
baseName = swiftName;
14781477
}

lib/ClangImporter/ImportName.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ class NameImporter {
226226
/// the same module as the decl
227227
bool hasNamingConflict(const clang::NamedDecl *decl,
228228
const clang::IdentifierInfo *proposedName,
229-
const clang::TypedefNameDecl *cfTypedef,
230-
clang::Sema &clangSema);
229+
const clang::TypedefNameDecl *cfTypedef);
231230

232231
Optional<ImportedErrorInfo>
233232
considerErrorImport(const clang::ObjCMethodDecl *clangDecl,
@@ -241,8 +240,7 @@ class NameImporter {
241240

242241
EffectiveClangContext determineEffectiveContext(const clang::NamedDecl *,
243242
const clang::DeclContext *,
244-
ImportNameOptions options,
245-
clang::Sema &clangSema);
243+
ImportNameOptions options);
246244

247245
ImportedName importNameImpl(const clang::NamedDecl *,
248246
ImportNameOptions options);

0 commit comments

Comments
 (0)