[clang] a112df2 - [diagtool] Use StringRef::consume_front (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 29 18:46:23 PST 2024
Author: Kazu Hirata
Date: 2024-01-29T18:46:11-08:00
New Revision: a112df28edc449e3e47101ffa7d4b6f0bc040c63
URL: https://github.com/llvm/llvm-project/commit/a112df28edc449e3e47101ffa7d4b6f0bc040c63
DIFF: https://github.com/llvm/llvm-project/commit/a112df28edc449e3e47101ffa7d4b6f0bc040c63.diff
LOG: [diagtool] Use StringRef::consume_front (NFC)
Added:
Modified:
clang/tools/diagtool/TreeView.cpp
Removed:
################################################################################
diff --git a/clang/tools/diagtool/TreeView.cpp b/clang/tools/diagtool/TreeView.cpp
index eae16243d3d59..00d1097b5fbfd 100644
--- a/clang/tools/diagtool/TreeView.cpp
+++ b/clang/tools/diagtool/TreeView.cpp
@@ -160,8 +160,7 @@ int TreeView::run(unsigned int argc, char **argv, llvm::raw_ostream &out) {
break;
case 1:
RootGroup = argv[0];
- if (RootGroup.starts_with("-W"))
- RootGroup = RootGroup.substr(2);
+ RootGroup.consume_front("-W");
if (RootGroup == "everything")
ShowAll = true;
// FIXME: Handle other special warning flags, like -pedantic.
More information about the cfe-commits
mailing list