aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Expression/IRExecutionUnit.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-12-16 14:39:37 -0800
committerKazu Hirata <kazu@google.com>2023-12-16 14:39:37 -0800
commit744f38913fa380580431df0ae89ef5fb3df30240 (patch)
tree538d4e6bc7bf3d7c8d69232316ff89b82e1a2d7a /lldb/source/Expression/IRExecutionUnit.cpp
parent01c8af573961c54f0d922c3f3acffa880a0a459c (diff)
downloadllvm-744f38913fa380580431df0ae89ef5fb3df30240.tar.gz
llvm-744f38913fa380580431df0ae89ef5fb3df30240.tar.bz2
llvm-744f38913fa380580431df0ae89ef5fb3df30240.zip
[lldb] Use StringRef::{starts,ends}_with (NFC)
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
Diffstat (limited to 'lldb/source/Expression/IRExecutionUnit.cpp')
-rw-r--r--lldb/source/Expression/IRExecutionUnit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index 562bf3cdd2ed..0682746e448e 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -537,7 +537,7 @@ lldb::SectionType IRExecutionUnit::GetSectionTypeFromSectionName(
sect_type = lldb::eSectionTypeCode;
else if (name.equals("__data") || name.equals(".data"))
sect_type = lldb::eSectionTypeCode;
- else if (name.startswith("__debug_") || name.startswith(".debug_")) {
+ else if (name.starts_with("__debug_") || name.starts_with(".debug_")) {
const uint32_t name_idx = name[0] == '_' ? 8 : 7;
llvm::StringRef dwarf_name(name.substr(name_idx));
switch (dwarf_name[0]) {
@@ -596,7 +596,7 @@ lldb::SectionType IRExecutionUnit::GetSectionTypeFromSectionName(
default:
break;
}
- } else if (name.startswith("__apple_") || name.startswith(".apple_"))
+ } else if (name.starts_with("__apple_") || name.starts_with(".apple_"))
sect_type = lldb::eSectionTypeInvalid;
else if (name.equals("__objc_imageinfo"))
sect_type = lldb::eSectionTypeOther;