aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-08-28 01:13:46 -0700
committerGitHub <noreply@github.com>2024-08-28 01:13:46 -0700
commit22e55ba3293f72df84de509db821b4d8a2c4c55e (patch)
tree16afbe92c0c6513e07f19c767aec28bb9124ecb8 /llvm/lib/FileCheck/FileCheck.cpp
parent6332c36bc846e7cba5c8cc1f865ca506539692fc (diff)
downloadllvm-22e55ba3293f72df84de509db821b4d8a2c4c55e.zip
llvm-22e55ba3293f72df84de509db821b4d8a2c4c55e.tar.gz
llvm-22e55ba3293f72df84de509db821b4d8a2c4c55e.tar.bz2
[llvm] Prefer StringRef::substr to StringRef::slice (NFC) (#106330)
S.substr(N) is simpler than S.slice(N, StringRef::npos). Also, substr is probably better recognizable than slice thanks to std::string_view::substr.
Diffstat (limited to 'llvm/lib/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/lib/FileCheck/FileCheck.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp
index df5f7f4..b6c2838 100644
--- a/llvm/lib/FileCheck/FileCheck.cpp
+++ b/llvm/lib/FileCheck/FileCheck.cpp
@@ -298,7 +298,7 @@ Pattern::parseVariable(StringRef &Str, const SourceMgr &SM) {
++I;
if (I == Str.size())
- return ErrorDiagnostic::get(SM, Str.slice(I, StringRef::npos),
+ return ErrorDiagnostic::get(SM, Str.substr(I),
StringRef("empty ") +
(IsPseudo ? "pseudo " : "global ") +
"variable name");