diff --git a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp --- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -383,14 +383,14 @@ } void AnalysisConsumer::storeTopLevelDecls(DeclGroupRef DG) { - for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I) { + for (auto &I : DG) { // Skip ObjCMethodDecl, wait for the objc container to avoid // analyzing twice. - if (isa(*I)) + if (isa(I)) continue; - LocalTUDecls.push_back(*I); + LocalTUDecls.push_back(I); } } @@ -462,11 +462,9 @@ SetOfConstDecls Visited; SetOfConstDecls VisitedAsTopLevel; llvm::ReversePostOrderTraversal RPOT(&CG); - for (llvm::ReversePostOrderTraversal::rpo_iterator - I = RPOT.begin(), E = RPOT.end(); I != E; ++I) { + for (auto &N : RPOT) { NumFunctionTopLevel++; - CallGraphNode *N = *I; Decl *D = N->getDecl(); // Skip the abstract root node.