aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-12-25 12:54:35 -0800
committerKazu Hirata <kazu@google.com>2023-12-25 12:54:35 -0800
commit68f832f56da1af0e5fc77003f640648ec7d901ad (patch)
tree6dbeb4136ae804a4aba66c94a778456344f3ec13 /clang/lib/CodeGen/CodeGenAction.cpp
parent9e98f8d7ac11c63768b1ed69c11ea75c8b794063 (diff)
downloadllvm-68f832f56da1af0e5fc77003f640648ec7d901ad.zip
llvm-68f832f56da1af0e5fc77003f640648ec7d901ad.tar.gz
llvm-68f832f56da1af0e5fc77003f640648ec7d901ad.tar.bz2
[clang] Use StringRef::consume_front (NFC)
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 753a8fd..f8038497 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -1139,8 +1139,7 @@ CodeGenAction::loadModule(MemoryBufferRef MBRef) {
// Strip off a leading diagnostic code if there is one.
StringRef Msg = Err.getMessage();
- if (Msg.starts_with("error: "))
- Msg = Msg.substr(7);
+ Msg.consume_front("error: ");
unsigned DiagID =
CI.getDiagnostics().getCustomDiagID(DiagnosticsEngine::Error, "%0");