@@ -813,7 +813,7 @@ applyPropertyOwnership(VarDecl *prop,
813813static bool isPrintLikeMethod (DeclName name, const DeclContext *dc) {
814814 if (!name || name.isSpecial () || name.isSimpleName ())
815815 return false ;
816- if (name.getBaseIdentifier ().str () != " print" )
816+ if (name.getBaseName ().userFacingName () != " print" )
817817 return false ;
818818 if (!dc->isTypeContext ())
819819 return false ;
@@ -1188,7 +1188,7 @@ namespace {
11881188
11891189 auto *enumDecl = Impl.createDeclWithClangNode <EnumDecl>(
11901190 decl, AccessLevel::Public, Impl.importSourceLoc (decl->getBeginLoc ()),
1191- importedName.getDeclName (). getBaseIdentifier (),
1191+ importedName.getBaseIdentifier (Impl. SwiftContext ),
11921192 Impl.importSourceLoc (decl->getLocation ()), llvm::None, nullptr , dc);
11931193 // TODO: we only have this for the sid effect of calling
11941194 // "FirstDeclAndLazyMembers.setInt(true)".
@@ -1222,7 +1222,7 @@ namespace {
12221222 ImportedName importedName;
12231223 llvm::Optional<ImportedName> correctSwiftName;
12241224 std::tie (importedName, correctSwiftName) = importFullName (decl);
1225- auto name = importedName.getDeclName (). getBaseIdentifier ();
1225+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
12261226 if (name.empty ())
12271227 return nullptr ;
12281228
@@ -1365,7 +1365,7 @@ namespace {
13651365 ImportedName importedName;
13661366 llvm::Optional<ImportedName> correctSwiftName;
13671367 std::tie (importedName, correctSwiftName) = importFullName (Decl);
1368- auto Name = importedName.getDeclName (). getBaseIdentifier ();
1368+ auto Name = importedName.getBaseIdentifier (Impl. SwiftContext );
13691369 if (Name.empty ())
13701370 return nullptr ;
13711371
@@ -1599,7 +1599,7 @@ namespace {
15991599 if (!dc)
16001600 return nullptr ;
16011601
1602- auto name = importedName.getDeclName (). getBaseIdentifier ();
1602+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
16031603
16041604 // Create the enum declaration and record it.
16051605 ImportDiagnosticAdder addDiag (Impl, decl, decl->getLocation ());
@@ -1959,7 +1959,7 @@ namespace {
19591959 if (unimported != constant && enumeratorDecl) {
19601960 ImportedName importedName =
19611961 Impl.importFullName (constant, getActiveSwiftVersion ());
1962- Identifier name = importedName.getDeclName (). getBaseIdentifier ();
1962+ Identifier name = importedName.getBaseIdentifier (Impl. SwiftContext );
19631963 if (name.empty ()) {
19641964 // Clear the existing declaration so we don't try to process it
19651965 // twice later.
@@ -2167,7 +2167,7 @@ namespace {
21672167 }
21682168
21692169 // Create the struct declaration and record it.
2170- auto name = importedName.getDeclName (). getBaseIdentifier ();
2170+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
21712171 NominalTypeDecl *result = nullptr ;
21722172 // Try to find an already-imported struct. This case happens any time
21732173 // there are nested structs. The "Parent" struct will import the "Child"
@@ -3016,7 +3016,7 @@ namespace {
30163016 std::tie (importedName, correctSwiftName) = importFullName (decl);
30173017 if (!importedName) return nullptr ;
30183018
3019- auto name = importedName.getDeclName (). getBaseIdentifier ();
3019+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
30203020 if (name.empty ())
30213021 return nullptr ;
30223022
@@ -3087,7 +3087,7 @@ namespace {
30873087 std::tie (importedName, correctSwiftName) = importFullName (decl);
30883088 if (!importedName) return nullptr ;
30893089
3090- auto name = importedName.getDeclName (). getBaseIdentifier ();
3090+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
30913091
30923092 auto dc =
30933093 Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
@@ -3573,8 +3573,7 @@ namespace {
35733573
35743574 Identifier bodyName =
35753575 Impl.importFullName (param, Impl.CurrentVersion )
3576- .getDeclName ()
3577- .getBaseIdentifier ();
3576+ .getBaseIdentifier (Impl.SwiftContext );
35783577 auto paramInfo = Impl.createDeclWithClangNode <ParamDecl>(
35793578 param, AccessLevel::Private, SourceLoc (), SourceLoc (),
35803579 Identifier (), Impl.importSourceLoc (param->getLocation ()),
@@ -3812,7 +3811,7 @@ namespace {
38123811 return nullptr ;
38133812 }
38143813
3815- auto name = importedName.getDeclName (). getBaseIdentifier ();
3814+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
38163815
38173816 auto dc =
38183817 Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
@@ -3900,7 +3899,7 @@ namespace {
39003899 std::tie (importedName, correctSwiftName) = importFullName (decl);
39013900 if (!importedName) return nullptr ;
39023901
3903- auto name = importedName.getDeclName (). getBaseIdentifier ();
3902+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
39043903 auto dc =
39053904 Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
39063905 if (!dc)
@@ -3979,7 +3978,7 @@ namespace {
39793978 Decl *VisitClassTemplateDecl (const clang::ClassTemplateDecl *decl) {
39803979 ImportedName importedName;
39813980 std::tie (importedName, std::ignore) = importFullName (decl);
3982- auto name = importedName.getDeclName (). getBaseIdentifier ();
3981+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
39833982 if (name.empty ())
39843983 return nullptr ;
39853984
@@ -4045,7 +4044,7 @@ namespace {
40454044 // Don't import something that doesn't have a name.
40464045 if (importedName.getDeclName ().isSpecial ())
40474046 return nullptr ;
4048- auto Name = importedName.getDeclName (). getBaseIdentifier ();
4047+ auto Name = importedName.getBaseIdentifier (Impl. SwiftContext );
40494048 if (Name.empty ())
40504049 return nullptr ;
40514050
@@ -4294,7 +4293,7 @@ namespace {
42944293
42954294 auto type = importedType.getType ();
42964295 const auto access = getOverridableAccessLevel (dc);
4297- auto ident = name.getDeclName (). getBaseIdentifier ();
4296+ auto ident = name.getBaseIdentifier (Impl. SwiftContext );
42984297 auto propDecl = Impl.createDeclWithClangNode <VarDecl>(decl, access,
42994298 /* IsStatic*/ decl->isClassMethod (), VarDecl::Introducer::Var,
43004299 Impl.importSourceLoc (decl->getLocation ()), ident, dc);
@@ -4990,7 +4989,7 @@ namespace {
49904989 return importCompatibilityTypeAlias (decl, importedName,
49914990 *correctSwiftName);
49924991
4993- Identifier name = importedName.getDeclName (). getBaseIdentifier ();
4992+ Identifier name = importedName.getBaseIdentifier (Impl. SwiftContext );
49944993 bool hasKnownSwiftName = importedName.hasCustomName ();
49954994
49964995 if (!decl->hasDefinition ()) {
@@ -5153,7 +5152,7 @@ namespace {
51535152 return importCompatibilityTypeAlias (decl, importedName,
51545153 *correctSwiftName);
51555154
5156- auto name = importedName.getDeclName (). getBaseIdentifier ();
5155+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
51575156 bool hasKnownSwiftName = importedName.hasCustomName ();
51585157
51595158 if (!decl->hasDefinition ()) {
@@ -5361,7 +5360,7 @@ namespace {
53615360 ImportedName importedName;
53625361 llvm::Optional<ImportedName> correctSwiftName;
53635362 std::tie (importedName, correctSwiftName) = importFullName (decl);
5364- auto name = importedName.getDeclName (). getBaseIdentifier ();
5363+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
53655364 if (name.empty ())
53665365 return nullptr ;
53675366
@@ -5505,7 +5504,7 @@ namespace {
55055504
55065505 ImportedName importedName;
55075506 std::tie (importedName, std::ignore) = importFullName (decl);
5508- auto name = importedName.getDeclName (). getBaseIdentifier ();
5507+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
55095508
55105509 if (name.empty ()) return nullptr ;
55115510 Decl *importedDecl =
@@ -5745,7 +5744,7 @@ Decl *SwiftDeclConverter::importCompatibilityTypeAlias(
57455744 // Create the type alias.
57465745 auto alias = Impl.createDeclWithClangNode <TypeAliasDecl>(
57475746 decl, AccessLevel::Public, Impl.importSourceLoc (decl->getBeginLoc ()),
5748- SourceLoc (), compatibilityName.getDeclName (). getBaseIdentifier (),
5747+ SourceLoc (), compatibilityName.getBaseIdentifier (Impl. SwiftContext ),
57495748 Impl.importSourceLoc (decl->getLocation ()), /* generic params*/ nullptr , dc);
57505749
57515750 auto *GTD = dyn_cast<GenericTypeDecl>(typeDecl);
@@ -5982,7 +5981,7 @@ Decl *SwiftDeclConverter::importEnumCase(const clang::EnumConstantDecl *decl,
59825981 ImportedName importedName;
59835982 llvm::Optional<ImportedName> correctSwiftName;
59845983 std::tie (importedName, correctSwiftName) = importFullName (decl);
5985- auto name = importedName.getDeclName (). getBaseIdentifier ();
5984+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
59865985 if (name.empty ())
59875986 return nullptr ;
59885987
@@ -6039,7 +6038,7 @@ SwiftDeclConverter::importOptionConstant(const clang::EnumConstantDecl *decl,
60396038 ImportedName nameInfo;
60406039 llvm::Optional<ImportedName> correctSwiftName;
60416040 std::tie (nameInfo, correctSwiftName) = importFullName (decl);
6042- Identifier name = nameInfo.getDeclName (). getBaseIdentifier ();
6041+ Identifier name = nameInfo.getBaseIdentifier (Impl. SwiftContext );
60436042 if (name.empty ())
60446043 return nullptr ;
60456044
@@ -6263,7 +6262,7 @@ SwiftDeclConverter::getImplicitProperty(ImportedName importedName,
62636262 }
62646263
62656264 // Find the other accessor, if it exists.
6266- auto propertyName = importedName.getDeclName (). getBaseIdentifier ();
6265+ auto propertyName = importedName.getBaseIdentifier (Impl. SwiftContext );
62676266 auto lookupTable =
62686267 Impl.findLookupTable (*getClangSubmoduleForDecl (accessor));
62696268 assert (lookupTable && " No lookup table?" );
@@ -9451,8 +9450,7 @@ ClangImporter::Implementation::getSpecialTypedefKind(
94519450Identifier
94529451ClangImporter::getEnumConstantName (const clang::EnumConstantDecl *enumConstant){
94539452 return Impl.importFullName (enumConstant, Impl.CurrentVersion )
9454- .getDeclName ()
9455- .getBaseIdentifier ();
9453+ .getBaseIdentifier (Impl.SwiftContext );
94569454}
94579455
94589456// See swift/Basic/Statistic.h for declaration: this enables tracing
0 commit comments