Skip to content

Commit 90518f6

Browse files
committedJun 20, 2024
rename deprecated startswith() to starts_with()
Signed-off-by: Ruowen Qin <chinqrw@gmail.com>
1 parent 31bdea8 commit 90518f6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
 

‎llvm/lib/Target/X86/X86IUFrameSize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ uint64_t X86IUFrameSizePassMF::getFrameSize(const MachineFunction &MF) {
206206
std::string Demangled;
207207
nonMicrosoftDemangle(CalledFunction->getName().data(), Demangled);
208208
// skip if the function is a core function
209-
if (StringRef(Demangled).startswith(StringRef("<core::")) ||
210-
StringRef(Demangled).startswith(StringRef("core::"))) {
209+
if (StringRef(Demangled).starts_with(StringRef("<core::")) ||
210+
StringRef(Demangled).starts_with(StringRef("core::"))) {
211211
AccumulatedSize += 24;
212212
continue;
213213
}
@@ -220,4 +220,4 @@ uint64_t X86IUFrameSizePassMF::getFrameSize(const MachineFunction &MF) {
220220
}
221221
}
222222
return MaxFrameSize;
223-
}
223+
}

‎llvm/lib/Transforms/InnerUnikernels/IUInsertEntry.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ void IUEntryInsertion::validateAndFinalizeSection(Function *EntryFn,
6868
#define IU_PROG_TYPE_1(ty_enum, ty_name, sec) \
6969
case ty_enum: \
7070
ProgObj->setSection("obj" #ty_name); \
71-
assert(EntryFn->getSection().startswith(sec) && "invalid section name"); \
71+
assert(EntryFn->getSection().starts_with(sec) && "invalid section name"); \
7272
break;
7373
#define IU_PROG_TYPE_2(ty_enum, ty_name, sec1, sec2) \
7474
case ty_enum: \
7575
ProgObj->setSection("obj" #ty_name); \
76-
assert((EntryFn->getSection().startswith(sec1) || \
77-
EntryFn->getSection().startswith(sec2)) && \
76+
assert((EntryFn->getSection().starts_with(sec1) || \
77+
EntryFn->getSection().starts_with(sec2)) && \
7878
"invalid section name"); \
7979
break;
8080
#include "llvm/Transforms/InnerUnikernels/IUProgType.def"
@@ -165,7 +165,7 @@ bool IUEntryInsertion::runOnModule(Module &M) const {
165165

166166
// Traverse all Global variables
167167
for (GlobalVariable &G : M.globals()) {
168-
if (G.hasSection() && G.getSection().startswith("inner_unikernel")) {
168+
if (G.hasSection() && G.getSection().starts_with("inner_unikernel")) {
169169
Constant *Init = G.getInitializer();
170170
auto *CS = cast<ConstantStruct>(Init);
171171

@@ -266,7 +266,7 @@ bool IUEntryInsertion::instrumentStack(Module &M, LLVMContext &C) const {
266266
for (auto &F : M) {
267267
std::string Demangled;
268268
nonMicrosoftDemangle(F.getName().data(), Demangled);
269-
if (StringRef(Demangled).startswith(StringRef("inner_unikernel_rt::")))
269+
if (StringRef(Demangled).starts_with(StringRef("inner_unikernel_rt::")))
270270
continue;
271271
for (auto &I : instructions(F)) {
272272
if (auto *CI = dyn_cast<CallBase>(&I)) {

0 commit comments

Comments
 (0)