[clang] fe21b39 - [Basic] Use range-based for loops (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 24 23:38:31 PST 2023
Author: Kazu Hirata
Date: 2023-12-24T23:38:25-08:00
New Revision: fe21b3941df24420b72e789dcf67de2dc17c4417
URL: https://github.com/llvm/llvm-project/commit/fe21b3941df24420b72e789dcf67de2dc17c4417
DIFF: https://github.com/llvm/llvm-project/commit/fe21b3941df24420b72e789dcf67de2dc17c4417.diff
LOG: [Basic] Use range-based for loops (NFC)
Added:
Modified:
clang/include/clang/Basic/PlistSupport.h
clang/lib/Basic/Warnings.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/PlistSupport.h b/clang/include/clang/Basic/PlistSupport.h
index 557462a5b90d01..d52d196019cf84 100644
--- a/clang/include/clang/Basic/PlistSupport.h
+++ b/clang/include/clang/Basic/PlistSupport.h
@@ -77,8 +77,7 @@ inline raw_ostream &EmitInteger(raw_ostream &o, int64_t value) {
inline raw_ostream &EmitString(raw_ostream &o, StringRef s) {
o << "<string>";
- for (StringRef::const_iterator I = s.begin(), E = s.end(); I != E; ++I) {
- char c = *I;
+ for (char c : s) {
switch (c) {
default:
o << c;
diff --git a/clang/lib/Basic/Warnings.cpp b/clang/lib/Basic/Warnings.cpp
index cb23d844ef8f6f..bab1af4f03b67b 100644
--- a/clang/lib/Basic/Warnings.cpp
+++ b/clang/lib/Basic/Warnings.cpp
@@ -198,8 +198,7 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
}
}
- for (unsigned i = 0, e = Opts.Remarks.size(); i != e; ++i) {
- StringRef Opt = Opts.Remarks[i];
+ for (StringRef Opt : Opts.Remarks) {
const auto Flavor = diag::Flavor::Remark;
// Check to see if this warning starts with "no-", if so, this is a
More information about the cfe-commits
mailing list