@@ -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 ());
@@ -3570,8 +3570,7 @@ namespace {
3570
3570
3571
3571
Identifier bodyName =
3572
3572
Impl.importFullName (param, Impl.CurrentVersion )
3573
- .getDeclName ()
3574
- .getBaseIdentifier ();
3573
+ .getBaseIdentifier (Impl.SwiftContext );
3575
3574
auto paramInfo = Impl.createDeclWithClangNode <ParamDecl>(
3576
3575
param, AccessLevel::Private, SourceLoc (), SourceLoc (),
3577
3576
Identifier (), Impl.importSourceLoc (param->getLocation ()),
@@ -3809,7 +3808,7 @@ namespace {
3809
3808
return nullptr ;
3810
3809
}
3811
3810
3812
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3811
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3813
3812
3814
3813
auto dc =
3815
3814
Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
@@ -3897,7 +3896,7 @@ namespace {
3897
3896
std::tie (importedName, correctSwiftName) = importFullName (decl);
3898
3897
if (!importedName) return nullptr ;
3899
3898
3900
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3899
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3901
3900
auto dc =
3902
3901
Impl.importDeclContextOf (decl, importedName.getEffectiveContext ());
3903
3902
if (!dc)
@@ -3976,7 +3975,7 @@ namespace {
3976
3975
Decl *VisitClassTemplateDecl (const clang::ClassTemplateDecl *decl) {
3977
3976
ImportedName importedName;
3978
3977
std::tie (importedName, std::ignore) = importFullName (decl);
3979
- auto name = importedName.getDeclName (). getBaseIdentifier ();
3978
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
3980
3979
if (name.empty ())
3981
3980
return nullptr ;
3982
3981
@@ -4042,7 +4041,7 @@ namespace {
4042
4041
// Don't import something that doesn't have a name.
4043
4042
if (importedName.getDeclName ().isSpecial ())
4044
4043
return nullptr ;
4045
- auto Name = importedName.getDeclName (). getBaseIdentifier ();
4044
+ auto Name = importedName.getBaseIdentifier (Impl. SwiftContext );
4046
4045
if (Name.empty ())
4047
4046
return nullptr ;
4048
4047
@@ -4291,7 +4290,7 @@ namespace {
4291
4290
4292
4291
auto type = importedType.getType ();
4293
4292
const auto access = getOverridableAccessLevel (dc);
4294
- auto ident = name.getDeclName (). getBaseIdentifier ();
4293
+ auto ident = name.getBaseIdentifier (Impl. SwiftContext );
4295
4294
auto propDecl = Impl.createDeclWithClangNode <VarDecl>(decl, access,
4296
4295
/* IsStatic*/ decl->isClassMethod (), VarDecl::Introducer::Var,
4297
4296
Impl.importSourceLoc (decl->getLocation ()), ident, dc);
@@ -4987,7 +4986,7 @@ namespace {
4987
4986
return importCompatibilityTypeAlias (decl, importedName,
4988
4987
*correctSwiftName);
4989
4988
4990
- Identifier name = importedName.getDeclName (). getBaseIdentifier ();
4989
+ Identifier name = importedName.getBaseIdentifier (Impl. SwiftContext );
4991
4990
bool hasKnownSwiftName = importedName.hasCustomName ();
4992
4991
4993
4992
if (!decl->hasDefinition ()) {
@@ -5150,7 +5149,7 @@ namespace {
5150
5149
return importCompatibilityTypeAlias (decl, importedName,
5151
5150
*correctSwiftName);
5152
5151
5153
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5152
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5154
5153
bool hasKnownSwiftName = importedName.hasCustomName ();
5155
5154
5156
5155
if (!decl->hasDefinition ()) {
@@ -5358,7 +5357,7 @@ namespace {
5358
5357
ImportedName importedName;
5359
5358
llvm::Optional<ImportedName> correctSwiftName;
5360
5359
std::tie (importedName, correctSwiftName) = importFullName (decl);
5361
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5360
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5362
5361
if (name.empty ())
5363
5362
return nullptr ;
5364
5363
@@ -5502,7 +5501,7 @@ namespace {
5502
5501
5503
5502
ImportedName importedName;
5504
5503
std::tie (importedName, std::ignore) = importFullName (decl);
5505
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5504
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5506
5505
5507
5506
if (name.empty ()) return nullptr ;
5508
5507
Decl *importedDecl =
@@ -5742,7 +5741,7 @@ Decl *SwiftDeclConverter::importCompatibilityTypeAlias(
5742
5741
// Create the type alias.
5743
5742
auto alias = Impl.createDeclWithClangNode <TypeAliasDecl>(
5744
5743
decl, AccessLevel::Public, Impl.importSourceLoc (decl->getBeginLoc ()),
5745
- SourceLoc (), compatibilityName.getDeclName (). getBaseIdentifier (),
5744
+ SourceLoc (), compatibilityName.getBaseIdentifier (Impl. SwiftContext ),
5746
5745
Impl.importSourceLoc (decl->getLocation ()), /* generic params*/ nullptr , dc);
5747
5746
5748
5747
auto *GTD = dyn_cast<GenericTypeDecl>(typeDecl);
@@ -5979,7 +5978,7 @@ Decl *SwiftDeclConverter::importEnumCase(const clang::EnumConstantDecl *decl,
5979
5978
ImportedName importedName;
5980
5979
llvm::Optional<ImportedName> correctSwiftName;
5981
5980
std::tie (importedName, correctSwiftName) = importFullName (decl);
5982
- auto name = importedName.getDeclName (). getBaseIdentifier ();
5981
+ auto name = importedName.getBaseIdentifier (Impl. SwiftContext );
5983
5982
if (name.empty ())
5984
5983
return nullptr ;
5985
5984
@@ -6036,7 +6035,7 @@ SwiftDeclConverter::importOptionConstant(const clang::EnumConstantDecl *decl,
6036
6035
ImportedName nameInfo;
6037
6036
llvm::Optional<ImportedName> correctSwiftName;
6038
6037
std::tie (nameInfo, correctSwiftName) = importFullName (decl);
6039
- Identifier name = nameInfo.getDeclName (). getBaseIdentifier ();
6038
+ Identifier name = nameInfo.getBaseIdentifier (Impl. SwiftContext );
6040
6039
if (name.empty ())
6041
6040
return nullptr ;
6042
6041
@@ -6260,7 +6259,7 @@ SwiftDeclConverter::getImplicitProperty(ImportedName importedName,
6260
6259
}
6261
6260
6262
6261
// Find the other accessor, if it exists.
6263
- auto propertyName = importedName.getDeclName (). getBaseIdentifier ();
6262
+ auto propertyName = importedName.getBaseIdentifier (Impl. SwiftContext );
6264
6263
auto lookupTable =
6265
6264
Impl.findLookupTable (*getClangSubmoduleForDecl (accessor));
6266
6265
assert (lookupTable && " No lookup table?" );
@@ -9448,8 +9447,7 @@ ClangImporter::Implementation::getSpecialTypedefKind(
9448
9447
Identifier
9449
9448
ClangImporter::getEnumConstantName (const clang::EnumConstantDecl *enumConstant){
9450
9449
return Impl.importFullName (enumConstant, Impl.CurrentVersion )
9451
- .getDeclName ()
9452
- .getBaseIdentifier ();
9450
+ .getBaseIdentifier (Impl.SwiftContext );
9453
9451
}
9454
9452
9455
9453
// See swift/Basic/Statistic.h for declaration: this enables tracing
0 commit comments