aboutsummaryrefslogtreecommitdiff
path: root/bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-12-13 23:34:49 -0800
committerKazu Hirata <kazu@google.com>2023-12-13 23:34:49 -0800
commitad8fd5b18545f90a2c3abcd056e9c566721d8711 (patch)
tree7ff9fe6aff4be717ebaedd0002f16a52314b922a /bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
parentd5953e3e3092f7142a07aa012fc9665ede09e53b (diff)
downloadllvm-ad8fd5b18545f90a2c3abcd056e9c566721d8711.zip
llvm-ad8fd5b18545f90a2c3abcd056e9c566721d8711.tar.gz
llvm-ad8fd5b18545f90a2c3abcd056e9c566721d8711.tar.bz2
[BOLT] 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 'bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp')
-rw-r--r--bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp b/bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
index aa5c834..041d0d8 100644
--- a/bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
+++ b/bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp
@@ -120,7 +120,7 @@ void ExecutableFileMemoryManager::updateSection(
}
if (!IsCode && (SectionName == ".strtab" || SectionName == ".symtab" ||
- SectionName == "" || SectionName.startswith(".rela.")))
+ SectionName == "" || SectionName.starts_with(".rela.")))
return;
SmallVector<char, 256> Buf;
@@ -139,7 +139,7 @@ void ExecutableFileMemoryManager::updateSection(
}
BinarySection *Section = nullptr;
- if (!OrgSecPrefix.empty() && SectionName.startswith(OrgSecPrefix)) {
+ if (!OrgSecPrefix.empty() && SectionName.starts_with(OrgSecPrefix)) {
// Update the original section contents.
ErrorOr<BinarySection &> OrgSection =
BC.getUniqueSectionByName(SectionName.substr(OrgSecPrefix.length()));