summaryrefslogtreecommitdiff
path: root/clang/lib/ARCMigrate/ObjCMT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/ARCMigrate/ObjCMT.cpp')
-rw-r--r--clang/lib/ARCMigrate/ObjCMT.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp
index 5a25c88c65f6..ed363a46a200 100644
--- a/clang/lib/ARCMigrate/ObjCMT.cpp
+++ b/clang/lib/ARCMigrate/ObjCMT.cpp
@@ -562,7 +562,7 @@ static void rewriteToObjCProperty(const ObjCMethodDecl *Getter,
static bool IsCategoryNameWithDeprecatedSuffix(ObjCContainerDecl *D) {
if (ObjCCategoryDecl *CatDecl = dyn_cast<ObjCCategoryDecl>(D)) {
StringRef Name = CatDecl->getName();
- return Name.endswith("Deprecated");
+ return Name.ends_with("Deprecated");
}
return false;
}
@@ -1176,12 +1176,12 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx,
if (!SetterMethod) {
// try a different naming convention for getter: isXxxxx
StringRef getterNameString = getterName->getName();
- bool IsPrefix = getterNameString.startswith("is");
+ bool IsPrefix = getterNameString.starts_with("is");
// Note that we don't want to change an isXXX method of retainable object
// type to property (readonly or otherwise).
if (IsPrefix && GRT->isObjCRetainableType())
return false;
- if (IsPrefix || getterNameString.startswith("get")) {
+ if (IsPrefix || getterNameString.starts_with("get")) {
LengthOfPrefix = (IsPrefix ? 2 : 3);
const char *CGetterName = getterNameString.data() + LengthOfPrefix;
// Make sure that first character after "is" or "get" prefix can
@@ -1320,11 +1320,11 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx,
if (OIT_Family == OIT_Singleton || OIT_Family == OIT_ReturnsSelf) {
StringRef STRefMethodName(MethodName);
size_t len = 0;
- if (STRefMethodName.startswith("standard"))
+ if (STRefMethodName.starts_with("standard"))
len = strlen("standard");
- else if (STRefMethodName.startswith("shared"))
+ else if (STRefMethodName.starts_with("shared"))
len = strlen("shared");
- else if (STRefMethodName.startswith("default"))
+ else if (STRefMethodName.starts_with("default"))
len = strlen("default");
else
return;
@@ -1341,7 +1341,7 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx,
StringRef LoweredMethodName(MethodName);
std::string StringLoweredMethodName = LoweredMethodName.lower();
LoweredMethodName = StringLoweredMethodName;
- if (!LoweredMethodName.startswith(ClassNamePostfix))
+ if (!LoweredMethodName.starts_with(ClassNamePostfix))
return;
if (OIT_Family == OIT_ReturnsSelf)
ReplaceWithClasstype(*this, OM);