@@ -813,7 +813,7 @@ applyPropertyOwnership(VarDecl *prop,
813
813
static bool isPrintLikeMethod (DeclName name, const DeclContext *dc) {
814
814
if (!name || name.isSpecial () || name.isSimpleName ())
815
815
return false ;
816
- if (name.getBaseIdentifier ().str () != " print" )
816
+ if (name.getBaseName ().userFacingName () != " print" )
817
817
return false ;
818
818
if (!dc->isTypeContext ())
819
819
return false ;
@@ -1188,7 +1188,7 @@ namespace {
1188
1188
1189
1189
auto *enumDecl = Impl.createDeclWithClangNode <EnumDecl>(
1190
1190
decl, AccessLevel::Public, Impl.importSourceLoc (decl->getBeginLoc ()),
1191
- importedName.getDeclName (). getBaseIdentifier (),
1191
+ importedName.getBaseIdentifier (Impl. SwiftContext ),
1192
1192
Impl.importSourceLoc (decl->getLocation ()), llvm::None, nullptr , dc);
1193
1193
// TODO: we only have this for the sid effect of calling
1194
1194
// "FirstDeclAndLazyMembers.setInt(true)".
@@ -1222,7 +1222,7 @@ namespace {
1222
1222
ImportedName importedName;
1223
1223
llvm::Optional<ImportedName> correctSwiftName;
1224
1224
std::tie (importedName, correctSwiftName) = importFullName (decl);
1225
- auto name = importedName.getDeclName (). getBaseIdentifier ();
1225
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
1226
1226
if (name.empty ())
1227
1227
return nullptr ;
1228
1228
@@ -1365,7 +1365,7 @@ namespace {
1365
1365
ImportedName importedName;
1366
1366
llvm::Optional<ImportedName> correctSwiftName;
1367
1367
std::tie (importedName, correctSwiftName) = importFullName (Decl);
1368
- auto Name = importedName.getDeclName (). getBaseIdentifier ();
1368
+ auto Name = importedName.getBaseIdentifier (Impl. SwiftContext );
1369
1369
if (Name.empty ())
1370
1370
return nullptr ;
1371
1371
@@ -1599,7 +1599,7 @@ namespace {
1599
1599
if (!dc)
1600
1600
return nullptr ;
1601
1601
1602
- auto name = importedName.getDeclName (). getBaseIdentifier ();
1602
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
1603
1603
1604
1604
// Create the enum declaration and record it.
1605
1605
ImportDiagnosticAdder addDiag (Impl, decl, decl->getLocation ());
@@ -1959,7 +1959,7 @@ namespace {
1959
1959
if (unimported != constant && enumeratorDecl) {
1960
1960
ImportedName importedName =
1961
1961
Impl.importFullName (constant, getActiveSwiftVersion ());
1962
- Identifier name = importedName.getDeclName (). getBaseIdentifier ();
1962
+ Identifier name = importedName.getBaseIdentifier (Impl. SwiftContext );
1963
1963
if (name.empty ()) {
1964
1964
// Clear the existing declaration so we don't try to process it
1965
1965
// twice later.
@@ -2167,7 +2167,7 @@ namespace {
2167
2167
}
2168
2168
2169
2169
// Create the struct declaration and record it.
2170
- auto name = importedName.getDeclName (). getBaseIdentifier ();
2170
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
2171
2171
NominalTypeDecl *result = nullptr ;
2172
2172
// Try to find an already-imported struct. This case happens any time
2173
2173
// there are nested structs. The "Parent" struct will import the "Child"
@@ -3016,7 +3016,7 @@ namespace {
3016
3016
std::tie (importedName, correctSwiftName) = importFullName (decl);
3017
3017
if (!importedName) return nullptr ;
3018
3018
3019
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3019
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3020
3020
if (name.empty ())
3021
3021
return nullptr ;
3022
3022
@@ -3087,7 +3087,7 @@ namespace {
3087
3087
std::tie (importedName, correctSwiftName) = importFullName (decl);
3088
3088
if (!importedName) return nullptr ;
3089
3089
3090
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3090
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3091
3091
3092
3092
auto dc =
3093
3093
Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
@@ -3573,8 +3573,7 @@ namespace {
3573
3573
3574
3574
Identifier bodyName =
3575
3575
Impl.importFullName (param, Impl.CurrentVersion )
3576
- .getDeclName ()
3577
- .getBaseIdentifier ();
3576
+ .getBaseIdentifier (Impl.SwiftContext );
3578
3577
auto paramInfo = Impl.createDeclWithClangNode <ParamDecl>(
3579
3578
param, AccessLevel::Private, SourceLoc (), SourceLoc (),
3580
3579
Identifier (), Impl.importSourceLoc (param->getLocation ()),
@@ -3812,7 +3811,7 @@ namespace {
3812
3811
return nullptr ;
3813
3812
}
3814
3813
3815
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3814
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3816
3815
3817
3816
auto dc =
3818
3817
Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
@@ -3900,7 +3899,7 @@ namespace {
3900
3899
std::tie (importedName, correctSwiftName) = importFullName (decl);
3901
3900
if (!importedName) return nullptr ;
3902
3901
3903
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3902
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3904
3903
auto dc =
3905
3904
Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
3906
3905
if (!dc)
@@ -3979,7 +3978,7 @@ namespace {
3979
3978
Decl *VisitClassTemplateDecl (const clang::ClassTemplateDecl *decl) {
3980
3979
ImportedName importedName;
3981
3980
std::tie (importedName, std::ignore) = importFullName (decl);
3982
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3981
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3983
3982
if (name.empty ())
3984
3983
return nullptr ;
3985
3984
@@ -4045,7 +4044,7 @@ namespace {
4045
4044
// Don't import something that doesn't have a name.
4046
4045
if (importedName.getDeclName ().isSpecial ())
4047
4046
return nullptr ;
4048
- auto Name = importedName.getDeclName (). getBaseIdentifier ();
4047
+ auto Name = importedName.getBaseIdentifier (Impl. SwiftContext );
4049
4048
if (Name.empty ())
4050
4049
return nullptr ;
4051
4050
@@ -4294,7 +4293,7 @@ namespace {
4294
4293
4295
4294
auto type = importedType.getType ();
4296
4295
const auto access = getOverridableAccessLevel (dc);
4297
- auto ident = name.getDeclName (). getBaseIdentifier ();
4296
+ auto ident = name.getBaseIdentifier (Impl. SwiftContext );
4298
4297
auto propDecl = Impl.createDeclWithClangNode <VarDecl>(decl, access,
4299
4298
/* IsStatic*/ decl->isClassMethod (), VarDecl::Introducer::Var,
4300
4299
Impl.importSourceLoc (decl->getLocation ()), ident, dc);
@@ -4990,7 +4989,7 @@ namespace {
4990
4989
return importCompatibilityTypeAlias (decl, importedName,
4991
4990
*correctSwiftName);
4992
4991
4993
- Identifier name = importedName.getDeclName (). getBaseIdentifier ();
4992
+ Identifier name = importedName.getBaseIdentifier (Impl. SwiftContext );
4994
4993
bool hasKnownSwiftName = importedName.hasCustomName ();
4995
4994
4996
4995
if (!decl->hasDefinition ()) {
@@ -5153,7 +5152,7 @@ namespace {
5153
5152
return importCompatibilityTypeAlias (decl, importedName,
5154
5153
*correctSwiftName);
5155
5154
5156
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5155
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5157
5156
bool hasKnownSwiftName = importedName.hasCustomName ();
5158
5157
5159
5158
if (!decl->hasDefinition ()) {
@@ -5361,7 +5360,7 @@ namespace {
5361
5360
ImportedName importedName;
5362
5361
llvm::Optional<ImportedName> correctSwiftName;
5363
5362
std::tie (importedName, correctSwiftName) = importFullName (decl);
5364
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5363
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5365
5364
if (name.empty ())
5366
5365
return nullptr ;
5367
5366
@@ -5505,7 +5504,7 @@ namespace {
5505
5504
5506
5505
ImportedName importedName;
5507
5506
std::tie (importedName, std::ignore) = importFullName (decl);
5508
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5507
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5509
5508
5510
5509
if (name.empty ()) return nullptr ;
5511
5510
Decl *importedDecl =
@@ -5745,7 +5744,7 @@ Decl *SwiftDeclConverter::importCompatibilityTypeAlias(
5745
5744
// Create the type alias.
5746
5745
auto alias = Impl.createDeclWithClangNode <TypeAliasDecl>(
5747
5746
decl, AccessLevel::Public, Impl.importSourceLoc (decl->getBeginLoc ()),
5748
- SourceLoc (), compatibilityName.getDeclName (). getBaseIdentifier (),
5747
+ SourceLoc (), compatibilityName.getBaseIdentifier (Impl. SwiftContext ),
5749
5748
Impl.importSourceLoc (decl->getLocation ()), /* generic params*/ nullptr , dc);
5750
5749
5751
5750
auto *GTD = dyn_cast<GenericTypeDecl>(typeDecl);
@@ -5982,7 +5981,7 @@ Decl *SwiftDeclConverter::importEnumCase(const clang::EnumConstantDecl *decl,
5982
5981
ImportedName importedName;
5983
5982
llvm::Optional<ImportedName> correctSwiftName;
5984
5983
std::tie (importedName, correctSwiftName) = importFullName (decl);
5985
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5984
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5986
5985
if (name.empty ())
5987
5986
return nullptr ;
5988
5987
@@ -6039,7 +6038,7 @@ SwiftDeclConverter::importOptionConstant(const clang::EnumConstantDecl *decl,
6039
6038
ImportedName nameInfo;
6040
6039
llvm::Optional<ImportedName> correctSwiftName;
6041
6040
std::tie (nameInfo, correctSwiftName) = importFullName (decl);
6042
- Identifier name = nameInfo.getDeclName (). getBaseIdentifier ();
6041
+ Identifier name = nameInfo.getBaseIdentifier (Impl. SwiftContext );
6043
6042
if (name.empty ())
6044
6043
return nullptr ;
6045
6044
@@ -6263,7 +6262,7 @@ SwiftDeclConverter::getImplicitProperty(ImportedName importedName,
6263
6262
}
6264
6263
6265
6264
// Find the other accessor, if it exists.
6266
- auto propertyName = importedName.getDeclName (). getBaseIdentifier ();
6265
+ auto propertyName = importedName.getBaseIdentifier (Impl. SwiftContext );
6267
6266
auto lookupTable =
6268
6267
Impl.findLookupTable (*getClangSubmoduleForDecl (accessor));
6269
6268
assert (lookupTable && " No lookup table?" );
@@ -9451,8 +9450,7 @@ ClangImporter::Implementation::getSpecialTypedefKind(
9451
9450
Identifier
9452
9451
ClangImporter::getEnumConstantName (const clang::EnumConstantDecl *enumConstant){
9453
9452
return Impl.importFullName (enumConstant, Impl.CurrentVersion )
9454
- .getDeclName ()
9455
- .getBaseIdentifier ();
9453
+ .getBaseIdentifier (Impl.SwiftContext );
9456
9454
}
9457
9455
9458
9456
// See swift/Basic/Statistic.h for declaration: this enables tracing
0 commit comments