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")
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")
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits