Skip to content

Commit

Permalink
Replace deprecated startswith_insensitive with starts_with_insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jun 5, 2023
1 parent 73ce343 commit 65ceb42
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/MSVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
// find it.
for (const char *Cursor = EnvBlock.data(); *Cursor != '\0';) {
llvm::StringRef EnvVar(Cursor);
if (EnvVar.startswith_insensitive("path=")) {
if (EnvVar.starts_with_insensitive("path=")) {
constexpr size_t PrefixLen = 5; // strlen("path=")
Environment.push_back(Args.MakeArgString(
EnvVar.substr(0, PrefixLen) +
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/DataFormatters/FormatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static bool GetFormatFromFormatName(llvm::StringRef format_name,
if (partial_match_ok) {
for (i = 0; i < g_num_format_infos; ++i) {
if (llvm::StringRef(g_format_infos[i].format_name)
.startswith_insensitive(format_name)) {
.starts_with_insensitive(format_name)) {
format = g_format_infos[i].format;
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13749,13 +13749,13 @@ bool EmulateInstructionARM::SetArchitecture(const ArchSpec &arch) {
m_arm_isa = ARMvAll;
else if (arch_cstr.equals_insensitive("thumb"))
m_arm_isa = ARMvAll;
else if (arch_cstr.startswith_insensitive("armv4"))
else if (arch_cstr.starts_with_insensitive("armv4"))
m_arm_isa = ARMv4;
else if (arch_cstr.startswith_insensitive("armv6"))
else if (arch_cstr.starts_with_insensitive("armv6"))
m_arm_isa = ARMv6;
else if (arch_cstr.startswith_insensitive("armv7"))
else if (arch_cstr.starts_with_insensitive("armv7"))
m_arm_isa = ARMv7;
else if (arch_cstr.startswith_insensitive("armv8"))
else if (arch_cstr.starts_with_insensitive("armv8"))
m_arm_isa = ARMv8;
return m_arm_isa != 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ bool CPlusPlusLanguage::IsSourceFile(llvm::StringRef file_path) const {
const auto suffixes = {".cpp", ".cxx", ".c++", ".cc", ".c",
".h", ".hh", ".hpp", ".hxx", ".h++"};
for (auto suffix : suffixes) {
if (file_path.endswith_insensitive(suffix))
if (file_path.ends_with_insensitive(suffix))
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ bool ObjCLanguage::IsNilReference(ValueObject &valobj) {
bool ObjCLanguage::IsSourceFile(llvm::StringRef file_path) const {
const auto suffixes = {".h", ".m", ".M"};
for (auto suffix : suffixes) {
if (file_path.endswith_insensitive(suffix))
if (file_path.ends_with_insensitive(suffix))
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ LLDB_PLUGIN_DEFINE(ObjCPlusPlusLanguage)
bool ObjCPlusPlusLanguage::IsSourceFile(llvm::StringRef file_path) const {
const auto suffixes = {".h", ".mm"};
for (auto suffix : suffixes) {
if (file_path.endswith_insensitive(suffix))
if (file_path.ends_with_insensitive(suffix))
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void ProcessMinidump::ReadModuleList() {

// check if the process is wow64 - a 32 bit windows process running on a
// 64 bit windows
if (llvm::StringRef(name).endswith_insensitive("wow64.dll")) {
if (llvm::StringRef(name).ends_with_insensitive("wow64.dll")) {
m_is_wow64 = true;
}

Expand Down

0 comments on commit 65ceb42

Please sign in to comment.