Skip to content

Commit 586ecdf

Browse files
[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)
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.
1 parent d5fb4c0 commit 586ecdf

File tree

191 files changed

+645
-655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+645
-655
lines changed

llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ inline bool IsObjCIdentifiedObject(const Value *V) {
203203
StringRef Name = GV->getName();
204204
// These special variables are known to hold values which are not
205205
// reference-counted pointers.
206-
if (Name.startswith("\01l_objc_msgSend_fixup_"))
206+
if (Name.starts_with("\01l_objc_msgSend_fixup_"))
207207
return true;
208208

209209
StringRef Section = GV->getSection();

llvm/include/llvm/CodeGen/IndirectThunks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ template <typename Derived, typename InsertedThunksTy>
4848
void ThunkInserter<Derived, InsertedThunksTy>::createThunkFunction(
4949
MachineModuleInfo &MMI, StringRef Name, bool Comdat,
5050
StringRef TargetAttrs) {
51-
assert(Name.startswith(getDerived().getThunkPrefix()) &&
51+
assert(Name.starts_with(getDerived().getThunkPrefix()) &&
5252
"Created a thunk with an unexpected prefix!");
5353

5454
Module &M = const_cast<Module &>(*MMI.getModule());
@@ -94,7 +94,7 @@ template <typename Derived, typename InsertedThunksTy>
9494
bool ThunkInserter<Derived, InsertedThunksTy>::run(MachineModuleInfo &MMI,
9595
MachineFunction &MF) {
9696
// If MF is not a thunk, check to see if we need to insert a thunk.
97-
if (!MF.getName().startswith(getDerived().getThunkPrefix())) {
97+
if (!MF.getName().starts_with(getDerived().getThunkPrefix())) {
9898
// Only add a thunk if one of the functions has the corresponding feature
9999
// enabled in its subtarget, and doesn't enable external thunks. The target
100100
// can use InsertedThunks to detect whether relevant thunks have already

llvm/include/llvm/CodeGen/MIRYamlMapping.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ template <> struct ScalarTraits<FrameIndex> {
433433
static StringRef input(StringRef Scalar, void *Ctx, FrameIndex &FI) {
434434
FI.IsFixed = false;
435435
StringRef Num;
436-
if (Scalar.startswith("%stack.")) {
436+
if (Scalar.starts_with("%stack.")) {
437437
Num = Scalar.substr(7);
438-
} else if (Scalar.startswith("%fixed-stack.")) {
438+
} else if (Scalar.starts_with("%fixed-stack.")) {
439439
Num = Scalar.substr(13);
440440
FI.IsFixed = true;
441441
} else {

llvm/include/llvm/MC/MCSectionCOFF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class MCSectionCOFF final : public MCSection {
8383
}
8484

8585
static bool isImplicitlyDiscardable(StringRef Name) {
86-
return Name.startswith(".debug");
86+
return Name.starts_with(".debug");
8787
}
8888

8989
static bool classof(const MCSection *S) { return S->getVariant() == SV_COFF; }

llvm/include/llvm/Object/ELFObjectFile.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
742742
if (EF.getHeader().e_machine == ELF::EM_AARCH64) {
743743
if (Expected<StringRef> NameOrErr = getSymbolName(Sym)) {
744744
StringRef Name = *NameOrErr;
745-
if (Name.startswith("$d") || Name.startswith("$x"))
745+
if (Name.starts_with("$d") || Name.starts_with("$x"))
746746
Result |= SymbolRef::SF_FormatSpecific;
747747
} else {
748748
// TODO: Actually report errors helpfully.
@@ -752,8 +752,8 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
752752
if (Expected<StringRef> NameOrErr = getSymbolName(Sym)) {
753753
StringRef Name = *NameOrErr;
754754
// TODO Investigate why empty name symbols need to be marked.
755-
if (Name.empty() || Name.startswith("$d") || Name.startswith("$t") ||
756-
Name.startswith("$a"))
755+
if (Name.empty() || Name.starts_with("$d") || Name.starts_with("$t") ||
756+
Name.starts_with("$a"))
757757
Result |= SymbolRef::SF_FormatSpecific;
758758
} else {
759759
// TODO: Actually report errors helpfully.
@@ -764,7 +764,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
764764
} else if (EF.getHeader().e_machine == ELF::EM_CSKY) {
765765
if (Expected<StringRef> NameOrErr = getSymbolName(Sym)) {
766766
StringRef Name = *NameOrErr;
767-
if (Name.startswith("$d") || Name.startswith("$t"))
767+
if (Name.starts_with("$d") || Name.starts_with("$t"))
768768
Result |= SymbolRef::SF_FormatSpecific;
769769
} else {
770770
// TODO: Actually report errors helpfully.
@@ -775,7 +775,7 @@ Expected<uint32_t> ELFObjectFile<ELFT>::getSymbolFlags(DataRefImpl Sym) const {
775775
StringRef Name = *NameOrErr;
776776
// Mark empty name symbols (used for label differences) and mapping
777777
// symbols.
778-
if (Name.empty() || Name.startswith("$d") || Name.startswith("$x"))
778+
if (Name.empty() || Name.starts_with("$d") || Name.starts_with("$x"))
779779
Result |= SymbolRef::SF_FormatSpecific;
780780
} else {
781781
// TODO: Actually report errors helpfully.
@@ -973,8 +973,8 @@ bool ELFObjectFile<ELFT>::isDebugSection(DataRefImpl Sec) const {
973973
return false;
974974
}
975975
StringRef SectionName = SectionNameOrErr.get();
976-
return SectionName.startswith(".debug") ||
977-
SectionName.startswith(".zdebug") || SectionName == ".gdb_index";
976+
return SectionName.starts_with(".debug") ||
977+
SectionName.starts_with(".zdebug") || SectionName == ".gdb_index";
978978
}
979979

980980
template <class ELFT>

llvm/include/llvm/Passes/PassBuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,10 @@ template <typename AnalysisT, typename IRUnitT, typename AnalysisManagerT,
720720
bool parseAnalysisUtilityPasses(
721721
StringRef AnalysisName, StringRef PipelineName,
722722
PassManager<IRUnitT, AnalysisManagerT, ExtraArgTs...> &PM) {
723-
if (!PipelineName.endswith(">"))
723+
if (!PipelineName.ends_with(">"))
724724
return false;
725725
// See if this is an invalidate<> pass name
726-
if (PipelineName.startswith("invalidate<")) {
726+
if (PipelineName.starts_with("invalidate<")) {
727727
PipelineName = PipelineName.substr(11, PipelineName.size() - 12);
728728
if (PipelineName != AnalysisName)
729729
return false;
@@ -732,7 +732,7 @@ bool parseAnalysisUtilityPasses(
732732
}
733733

734734
// See if this is a require<> pass name
735-
if (PipelineName.startswith("require<")) {
735+
if (PipelineName.starts_with("require<")) {
736736
PipelineName = PipelineName.substr(8, PipelineName.size() - 9);
737737
if (PipelineName != AnalysisName)
738738
return false;

llvm/include/llvm/ProfileData/SampleProf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ class SampleContext {
548548
assert(!ContextStr.empty());
549549
// Note that `[]` wrapped input indicates a full context string, otherwise
550550
// it's treated as context-less function name only.
551-
bool HasContext = ContextStr.startswith("[");
551+
bool HasContext = ContextStr.starts_with("[");
552552
if (!HasContext) {
553553
State = UnknownContext;
554554
Func = FunctionId(ContextStr);

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ struct Attributor {
21612161
Function *F = I->getFunction();
21622162
auto &ORE = Configuration.OREGetter(F);
21632163

2164-
if (RemarkName.startswith("OMP"))
2164+
if (RemarkName.starts_with("OMP"))
21652165
ORE.emit([&]() {
21662166
return RemarkCB(RemarkKind(Configuration.PassName, RemarkName, I))
21672167
<< " [" << RemarkName << "]";
@@ -2181,7 +2181,7 @@ struct Attributor {
21812181

21822182
auto &ORE = Configuration.OREGetter(F);
21832183

2184-
if (RemarkName.startswith("OMP"))
2184+
if (RemarkName.starts_with("OMP"))
21852185
ORE.emit([&]() {
21862186
return RemarkCB(RemarkKind(Configuration.PassName, RemarkName, F))
21872187
<< " [" << RemarkName << "]";

llvm/lib/Analysis/LoopInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ MDNode *llvm::makePostTransformationMetadata(LLVMContext &Context,
11431143
if (S)
11441144
IsVectorMetadata =
11451145
llvm::any_of(RemovePrefixes, [S](StringRef Prefix) -> bool {
1146-
return S->getString().startswith(Prefix);
1146+
return S->getString().starts_with(Prefix);
11471147
});
11481148
}
11491149
if (!IsVectorMetadata)

llvm/lib/Analysis/VFABIDemangling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static ParseRet tryParseISA(StringRef &MangledName, VFISAKind &ISA) {
3232
if (MangledName.empty())
3333
return ParseRet::Error;
3434

35-
if (MangledName.startswith(VFABI::_LLVM_)) {
35+
if (MangledName.starts_with(VFABI::_LLVM_)) {
3636
MangledName = MangledName.drop_front(strlen(VFABI::_LLVM_));
3737
ISA = VFISAKind::LLVM;
3838
} else {

llvm/lib/AsmParser/LLLexer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,17 +922,17 @@ lltok::Kind LLLexer::LexIdentifier() {
922922

923923
#undef DWKEYWORD
924924

925-
if (Keyword.startswith("DIFlag")) {
925+
if (Keyword.starts_with("DIFlag")) {
926926
StrVal.assign(Keyword.begin(), Keyword.end());
927927
return lltok::DIFlag;
928928
}
929929

930-
if (Keyword.startswith("DISPFlag")) {
930+
if (Keyword.starts_with("DISPFlag")) {
931931
StrVal.assign(Keyword.begin(), Keyword.end());
932932
return lltok::DISPFlag;
933933
}
934934

935-
if (Keyword.startswith("CSK_")) {
935+
if (Keyword.starts_with("CSK_")) {
936936
StrVal.assign(Keyword.begin(), Keyword.end());
937937
return lltok::ChecksumKind;
938938
}

llvm/lib/BinaryFormat/Magic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using namespace llvm::sys::fs;
2626

2727
template <size_t N>
2828
static bool startswith(StringRef Magic, const char (&S)[N]) {
29-
return Magic.startswith(StringRef(S, N - 1));
29+
return Magic.starts_with(StringRef(S, N - 1));
3030
}
3131

3232
/// Identify the magic in magic.
@@ -217,11 +217,11 @@ file_magic llvm::identify_magic(StringRef Magic) {
217217
if (startswith(Magic, "MZ") && Magic.size() >= 0x3c + 4) {
218218
uint32_t off = read32le(Magic.data() + 0x3c);
219219
// PE/COFF file, either EXE or DLL.
220-
if (Magic.substr(off).startswith(
220+
if (Magic.substr(off).starts_with(
221221
StringRef(COFF::PEMagic, sizeof(COFF::PEMagic))))
222222
return file_magic::pecoff_executable;
223223
}
224-
if (Magic.startswith("Microsoft C/C++ MSF 7.00\r\n"))
224+
if (Magic.starts_with("Microsoft C/C++ MSF 7.00\r\n"))
225225
return file_magic::pdb;
226226
if (startswith(Magic, "MDMP"))
227227
return file_magic::minidump;

llvm/lib/Bitcode/Reader/MetadataLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
16331633
// DICompositeType flag specifying whether template parameters are
16341634
// required on declarations of this type.
16351635
StringRef NameStr = Name->getString();
1636-
if (!NameStr.contains('<') || NameStr.startswith("_STN|"))
1636+
if (!NameStr.contains('<') || NameStr.starts_with("_STN|"))
16371637
TemplateParams = getMDOrNull(Record[14]);
16381638
}
16391639
} else {

llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Error BasicBlockSectionsProfileReader::ReadV0Profile() {
302302
// specifier starting with `M=`.
303303
auto [AliasesStr, DIFilenameStr] = S.split(' ');
304304
SmallString<128> DIFilename;
305-
if (DIFilenameStr.startswith("M=")) {
305+
if (DIFilenameStr.starts_with("M=")) {
306306
DIFilename =
307307
sys::path::remove_leading_dotslash(DIFilenameStr.substr(2));
308308
if (DIFilename.empty())

llvm/lib/CodeGen/GlobalMerge.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,7 @@ bool GlobalMerge::doInitialization(Module &M) {
643643
StringRef Section = GV.getSection();
644644

645645
// Ignore all 'special' globals.
646-
if (GV.getName().startswith("llvm.") ||
647-
GV.getName().startswith(".llvm."))
646+
if (GV.getName().starts_with("llvm.") || GV.getName().starts_with(".llvm."))
648647
continue;
649648

650649
// Ignore all "required" globals:

llvm/lib/CodeGen/MIRParser/MILexer.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ static Cursor maybeLexIdentifier(Cursor C, MIToken &Token) {
300300

301301
static Cursor maybeLexMachineBasicBlock(Cursor C, MIToken &Token,
302302
ErrorCallbackType ErrorCallback) {
303-
bool IsReference = C.remaining().startswith("%bb.");
304-
if (!IsReference && !C.remaining().startswith("bb."))
303+
bool IsReference = C.remaining().starts_with("%bb.");
304+
if (!IsReference && !C.remaining().starts_with("bb."))
305305
return std::nullopt;
306306
auto Range = C;
307307
unsigned PrefixLength = IsReference ? 4 : 3;
@@ -335,7 +335,7 @@ static Cursor maybeLexMachineBasicBlock(Cursor C, MIToken &Token,
335335

336336
static Cursor maybeLexIndex(Cursor C, MIToken &Token, StringRef Rule,
337337
MIToken::TokenKind Kind) {
338-
if (!C.remaining().startswith(Rule) || !isdigit(C.peek(Rule.size())))
338+
if (!C.remaining().starts_with(Rule) || !isdigit(C.peek(Rule.size())))
339339
return std::nullopt;
340340
auto Range = C;
341341
C.advance(Rule.size());
@@ -348,7 +348,7 @@ static Cursor maybeLexIndex(Cursor C, MIToken &Token, StringRef Rule,
348348

349349
static Cursor maybeLexIndexAndName(Cursor C, MIToken &Token, StringRef Rule,
350350
MIToken::TokenKind Kind) {
351-
if (!C.remaining().startswith(Rule) || !isdigit(C.peek(Rule.size())))
351+
if (!C.remaining().starts_with(Rule) || !isdigit(C.peek(Rule.size())))
352352
return std::nullopt;
353353
auto Range = C;
354354
C.advance(Rule.size());
@@ -388,7 +388,7 @@ static Cursor maybeLexConstantPoolItem(Cursor C, MIToken &Token) {
388388
static Cursor maybeLexSubRegisterIndex(Cursor C, MIToken &Token,
389389
ErrorCallbackType ErrorCallback) {
390390
const StringRef Rule = "%subreg.";
391-
if (!C.remaining().startswith(Rule))
391+
if (!C.remaining().starts_with(Rule))
392392
return std::nullopt;
393393
return lexName(C, Token, MIToken::SubRegisterIndex, Rule.size(),
394394
ErrorCallback);
@@ -397,7 +397,7 @@ static Cursor maybeLexSubRegisterIndex(Cursor C, MIToken &Token,
397397
static Cursor maybeLexIRBlock(Cursor C, MIToken &Token,
398398
ErrorCallbackType ErrorCallback) {
399399
const StringRef Rule = "%ir-block.";
400-
if (!C.remaining().startswith(Rule))
400+
if (!C.remaining().starts_with(Rule))
401401
return std::nullopt;
402402
if (isdigit(C.peek(Rule.size())))
403403
return maybeLexIndex(C, Token, Rule, MIToken::IRBlock);
@@ -407,7 +407,7 @@ static Cursor maybeLexIRBlock(Cursor C, MIToken &Token,
407407
static Cursor maybeLexIRValue(Cursor C, MIToken &Token,
408408
ErrorCallbackType ErrorCallback) {
409409
const StringRef Rule = "%ir.";
410-
if (!C.remaining().startswith(Rule))
410+
if (!C.remaining().starts_with(Rule))
411411
return std::nullopt;
412412
if (isdigit(C.peek(Rule.size())))
413413
return maybeLexIndex(C, Token, Rule, MIToken::IRValue);
@@ -501,7 +501,7 @@ static Cursor maybeLexExternalSymbol(Cursor C, MIToken &Token,
501501
static Cursor maybeLexMCSymbol(Cursor C, MIToken &Token,
502502
ErrorCallbackType ErrorCallback) {
503503
const StringRef Rule = "<mcsymbol ";
504-
if (!C.remaining().startswith(Rule))
504+
if (!C.remaining().starts_with(Rule))
505505
return std::nullopt;
506506
auto Start = C;
507507
C.advance(Rule.size());

llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bool MachineSanitizerBinaryMetadata::runOnMachineFunction(MachineFunction &MF) {
5252
if (!MD)
5353
return false;
5454
const auto &Section = *cast<MDString>(MD->getOperand(0));
55-
if (!Section.getString().startswith(kSanitizerBinaryMetadataCoveredSection))
55+
if (!Section.getString().starts_with(kSanitizerBinaryMetadataCoveredSection))
5656
return false;
5757
auto &AuxMDs = *cast<MDTuple>(MD->getOperand(1));
5858
// Assume it currently only has features.

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -478,26 +478,21 @@ static SectionKind getELFKindForNamedSection(StringRef Name, SectionKind K) {
478478
if (Name.empty() || Name[0] != '.') return K;
479479

480480
// Default implementation based on some magic section names.
481-
if (Name == ".bss" ||
482-
Name.startswith(".bss.") ||
483-
Name.startswith(".gnu.linkonce.b.") ||
484-
Name.startswith(".llvm.linkonce.b.") ||
485-
Name == ".sbss" ||
486-
Name.startswith(".sbss.") ||
487-
Name.startswith(".gnu.linkonce.sb.") ||
488-
Name.startswith(".llvm.linkonce.sb."))
481+
if (Name == ".bss" || Name.starts_with(".bss.") ||
482+
Name.starts_with(".gnu.linkonce.b.") ||
483+
Name.starts_with(".llvm.linkonce.b.") || Name == ".sbss" ||
484+
Name.starts_with(".sbss.") || Name.starts_with(".gnu.linkonce.sb.") ||
485+
Name.starts_with(".llvm.linkonce.sb."))
489486
return SectionKind::getBSS();
490487

491-
if (Name == ".tdata" ||
492-
Name.startswith(".tdata.") ||
493-
Name.startswith(".gnu.linkonce.td.") ||
494-
Name.startswith(".llvm.linkonce.td."))
488+
if (Name == ".tdata" || Name.starts_with(".tdata.") ||
489+
Name.starts_with(".gnu.linkonce.td.") ||
490+
Name.starts_with(".llvm.linkonce.td."))
495491
return SectionKind::getThreadData();
496492

497-
if (Name == ".tbss" ||
498-
Name.startswith(".tbss.") ||
499-
Name.startswith(".gnu.linkonce.tb.") ||
500-
Name.startswith(".llvm.linkonce.tb."))
493+
if (Name == ".tbss" || Name.starts_with(".tbss.") ||
494+
Name.starts_with(".gnu.linkonce.tb.") ||
495+
Name.starts_with(".llvm.linkonce.tb."))
501496
return SectionKind::getThreadBSS();
502497

503498
return K;
@@ -512,7 +507,7 @@ static unsigned getELFSectionType(StringRef Name, SectionKind K) {
512507
// Use SHT_NOTE for section whose name starts with ".note" to allow
513508
// emitting ELF notes from C variable declaration.
514509
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77609
515-
if (Name.startswith(".note"))
510+
if (Name.starts_with(".note"))
516511
return ELF::SHT_NOTE;
517512

518513
if (hasPrefix(Name, ".init_array"))
@@ -752,7 +747,7 @@ calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName,
752747
getELFSectionNameForGlobal(GO, Kind, Mang, TM, EntrySize, false);
753748
if (SymbolMergeable &&
754749
Ctx.isELFImplicitMergeableSectionNamePrefix(SectionName) &&
755-
SectionName.startswith(ImplicitSectionNameStem))
750+
SectionName.starts_with(ImplicitSectionNameStem))
756751
return MCContext::GenericSectionID;
757752

758753
// We have seen this section name before, but with different flags or entity
@@ -1036,7 +1031,7 @@ MCSection *TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(
10361031
SmallString<128> Name;
10371032
StringRef FunctionSectionName = MBB.getParent()->getSection()->getName();
10381033
if (FunctionSectionName.equals(".text") ||
1039-
FunctionSectionName.startswith(".text.")) {
1034+
FunctionSectionName.starts_with(".text.")) {
10401035
// Function is in a regular .text section.
10411036
StringRef FunctionName = MBB.getParent()->getName();
10421037
if (MBB.getSectionID() == MBBSectionID::ColdSectionID) {

llvm/lib/CodeGen/WinEHPrepare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void llvm::calculateSEHStateForAsynchEH(const BasicBlock *BB, int State,
324324
const Constant *FilterOrNull = cast<Constant>(
325325
cast<CatchPadInst>(I)->getArgOperand(0)->stripPointerCasts());
326326
const Function *Filter = dyn_cast<Function>(FilterOrNull);
327-
if (!Filter || !Filter->getName().startswith("__IsLocalUnwind"))
327+
if (!Filter || !Filter->getName().starts_with("__IsLocalUnwind"))
328328
State = EHInfo.SEHUnwindMap[State].ToState; // Retrive next State
329329
} else if ((isa<CleanupReturnInst>(TI) || isa<CatchReturnInst>(TI)) &&
330330
State > 0) {

0 commit comments

Comments
 (0)