[PATCH] D71530: [Frontend] Fixes -Wrange-loop-analysis warnings
Mark de Wever via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 15 10:41:44 PST 2019
Mordante created this revision.
Mordante added reviewers: rsmith, aaron.ballman, xbolva00.
Mordante added a project: clang.
This avoids new warnings due to D68912 <https://reviews.llvm.org/D68912> adds -Wrange-loop-analysis to -Wall.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D71530
Files:
clang/lib/Frontend/CompilerInvocation.cpp
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -334,7 +334,7 @@
StringRef CheckerAndPackageList = A->getValue();
SmallVector<StringRef, 16> CheckersAndPackages;
CheckerAndPackageList.split(CheckersAndPackages, ",");
- for (const StringRef CheckerOrPackage : CheckersAndPackages)
+ for (const StringRef &CheckerOrPackage : CheckersAndPackages)
Opts.CheckersAndPackages.emplace_back(CheckerOrPackage, IsEnabled);
}
@@ -476,7 +476,7 @@
SmallVector<StringRef, 16> CheckersAndPackages;
AnOpts.RawSilencedCheckersAndPackages.split(CheckersAndPackages, ";");
- for (const StringRef CheckerOrPackage : CheckersAndPackages) {
+ for (const StringRef &CheckerOrPackage : CheckersAndPackages) {
if (Diags) {
bool IsChecker = CheckerOrPackage.contains('.');
bool IsValidName =
@@ -607,7 +607,7 @@
XRayInstrSet &S) {
llvm::SmallVector<StringRef, 2> BundleParts;
llvm::SplitString(Bundle, BundleParts, ",");
- for (const auto B : BundleParts) {
+ for (const auto &B : BundleParts) {
auto Mask = parseXRayInstrValue(B);
if (Mask == XRayInstrKind::None)
if (B != "none")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71530.233980.patch
Type: text/x-patch
Size: 1364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191215/6c5f8286/attachment-0001.bin>
More information about the cfe-commits
mailing list