Skip to content

Commit 6b29279

Browse files
committed
[X86] X86ISelLowering.cpp - use StringRef::starts_with/ends_with instead of startswith/endswith. NFC.
startswith/endswith wrap starts_with/ends_with and will eventually go away (to more closely match string_view)
1 parent 1ffea97 commit 6b29279

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31782,7 +31782,7 @@ static StringRef getInstrStrFromOpNo(const SmallVectorImpl<StringRef> &AsmStrs,
3178231782
for (auto &AsmStr : AsmStrs) {
3178331783
// Match the OpNo string. We should match exactly to exclude match
3178431784
// sub-string, e.g. "$12" contain "$1"
31785-
if (AsmStr.endswith(OpNoStr1))
31785+
if (AsmStr.ends_with(OpNoStr1))
3178631786
I = AsmStr.size() - OpNoStr1.size();
3178731787

3178831788
// Get the index of operand in AsmStr.
@@ -56317,7 +56317,7 @@ static bool matchAsm(StringRef S, ArrayRef<const char *> Pieces) {
5631756317
S = S.substr(S.find_first_not_of(" \t")); // Skip leading whitespace.
5631856318

5631956319
for (StringRef Piece : Pieces) {
56320-
if (!S.startswith(Piece)) // Check if the piece matches.
56320+
if (!S.starts_with(Piece)) // Check if the piece matches.
5632156321
return false;
5632256322

5632356323
S = S.substr(Piece.size());
@@ -57456,7 +57456,7 @@ X86TargetLowering::EmitKCFICheck(MachineBasicBlock &MBB,
5745657456
assert(Target.isSymbol() && "Unexpected target operand for a direct call");
5745757457
// X86TargetLowering::EmitLoweredIndirectThunk always uses r11 for
5745857458
// 64-bit indirect thunk calls.
57459-
assert(StringRef(Target.getSymbolName()).endswith("_r11") &&
57459+
assert(StringRef(Target.getSymbolName()).ends_with("_r11") &&
5746057460
"Unexpected register for an indirect thunk call");
5746157461
TargetReg = X86::R11;
5746257462
break;

0 commit comments

Comments
 (0)