diff options
author | Kazu Hirata <kazu@google.com> | 2023-12-13 22:46:02 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-12-13 22:46:02 -0800 |
commit | 5c9d82de6b72cc0c037daecce452c450870f0034 (patch) | |
tree | 6df2bfa36033214406a096235985cdde220765b4 /llvm/unittests/CodeGen/MachineInstrTest.cpp | |
parent | 2255795f281862b11e22920b982d57787808ecbb (diff) | |
download | llvm-5c9d82de6b72cc0c037daecce452c450870f0034.zip llvm-5c9d82de6b72cc0c037daecce452c450870f0034.tar.gz llvm-5c9d82de6b72cc0c037daecce452c450870f0034.tar.bz2 |
[llvm] 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 'llvm/unittests/CodeGen/MachineInstrTest.cpp')
-rw-r--r-- | llvm/unittests/CodeGen/MachineInstrTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp index 0841cd3..7c45d97 100644 --- a/llvm/unittests/CodeGen/MachineInstrTest.cpp +++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp @@ -222,9 +222,8 @@ TEST(MachineInstrPrintingTest, DebugLocPrinting) { MI->print(OS, /*IsStandalone*/true, /*SkipOpers*/false, /*SkipDebugLoc*/false, /*AddNewLine*/false); ASSERT_TRUE( - StringRef(OS.str()).startswith("$noreg = UNKNOWN debug-location ")); - ASSERT_TRUE( - StringRef(OS.str()).endswith("filename:1:5")); + StringRef(OS.str()).starts_with("$noreg = UNKNOWN debug-location ")); + ASSERT_TRUE(StringRef(OS.str()).ends_with("filename:1:5")); } TEST(MachineInstrSpan, DistanceBegin) { |