[PATCH] D71809: [Analyzer] Fixes -Wrange-loop-analysis warnings
Mark de Wever via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 22 10:15:30 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb6d9e976629a: [Analyzer] Fixes -Wrange-loop-analysis warnings (authored by Mordante).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71809/new/
https://reviews.llvm.org/D71809
Files:
clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp
clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
Index: clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
+++ clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp
@@ -591,7 +591,8 @@
/*MinLineWidth*/ 90);
Out << "\n\n";
};
- for (const std::pair<StringRef, const CmdLineOption &> &Entry : OptionMap) {
+ for (const std::pair<const StringRef, const CmdLineOption &> &Entry :
+ OptionMap) {
const CmdLineOption &Option = Entry.second;
std::string FullOption = (Entry.first + ":" + Option.OptionName).str();
Index: clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp
@@ -686,7 +686,7 @@
CheckerContext &C) const {
ProgramStateRef State = C.getState();
TrackedRegionMapTy TrackedRegions = State->get<TrackedRegionMap>();
- for (TrackedRegionMapTy::value_type E : TrackedRegions) {
+ for (const auto &E : TrackedRegions) {
const MemRegion *Region = E.first;
bool IsRegDead = !SymReaper.isLiveRegion(Region);
Index: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp
+++ clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp
@@ -1100,7 +1100,7 @@
if (!ContMap.isEmpty()) {
Out << Sep << "Container Data :" << NL;
- for (const auto Cont : ContMap) {
+ for (const auto &Cont : ContMap) {
Cont.first->dumpToStream(Out);
Out << " : [ ";
const auto CData = Cont.second;
@@ -1122,7 +1122,7 @@
if (!SymbolMap.isEmpty() || !RegionMap.isEmpty()) {
Out << Sep << "Iterator Positions :" << NL;
- for (const auto Sym : SymbolMap) {
+ for (const auto &Sym : SymbolMap) {
Sym.first->dumpToStream(Out);
Out << " : ";
const auto Pos = Sym.second;
@@ -1132,7 +1132,7 @@
Pos.getOffset()->dumpToStream(Out);
}
- for (const auto Reg : RegionMap) {
+ for (const auto &Reg : RegionMap) {
Reg.first->dumpToStream(Out);
Out << " : ";
const auto Pos = Reg.second;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71809.235063.patch
Type: text/x-patch
Size: 2362 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191222/3dc5ea37/attachment.bin>
More information about the cfe-commits
mailing list