diff options
author | Kazu Hirata <kazu@google.com> | 2023-12-25 12:54:35 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-12-25 12:54:35 -0800 |
commit | 68f832f56da1af0e5fc77003f640648ec7d901ad (patch) | |
tree | 6dbeb4136ae804a4aba66c94a778456344f3ec13 /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | 9e98f8d7ac11c63768b1ed69c11ea75c8b794063 (diff) | |
download | llvm-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.cpp | 3 |
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"); |