[clang] a3f379e - [Frontend] Use StringRef::consume_back (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 28 18:03:46 PST 2024


Author: Kazu Hirata
Date: 2024-01-28T18:03:33-08:00
New Revision: a3f379e4e9db9d88265e6dfc464fc3a5be3ae315

URL: https://github.com/llvm/llvm-project/commit/a3f379e4e9db9d88265e6dfc464fc3a5be3ae315
DIFF: https://github.com/llvm/llvm-project/commit/a3f379e4e9db9d88265e6dfc464fc3a5be3ae315.diff

LOG: [Frontend] Use StringRef::consume_back (NFC)

Added: 
    

Modified: 
    clang/lib/Frontend/VerifyDiagnosticConsumer.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
index f508408ba7062c3..304935a0a90b8e9 100644
--- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+++ b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
@@ -445,10 +445,9 @@ static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM,
     // others.
 
     // Regex in initial directive token: -re
-    if (DToken.ends_with("-re")) {
+    if (DToken.consume_back("-re")) {
       D.RegexKind = true;
       KindStr = "regex";
-      DToken = DToken.substr(0, DToken.size()-3);
     }
 
     // Type in initial directive token: -{error|warning|note|no-diagnostics}


        


More information about the cfe-commits mailing list