This revision was automatically updated to reflect the committed changes. Closed by commit rG65adf7c2117a: [NFC][Analyzer] Use range based for loop. (authored by junaire).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119103/new/ https://reviews.llvm.org/D119103 Files: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Index: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp =================================================================== --- clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ 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<ObjCMethodDecl>(*I)) + if (isa<ObjCMethodDecl>(I)) continue; - LocalTUDecls.push_back(*I); + LocalTUDecls.push_back(I); } } @@ -462,11 +462,9 @@ SetOfConstDecls Visited; SetOfConstDecls VisitedAsTopLevel; llvm::ReversePostOrderTraversal<clang::CallGraph*> RPOT(&CG); - for (llvm::ReversePostOrderTraversal<clang::CallGraph*>::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.
Index: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp =================================================================== --- clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ 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<ObjCMethodDecl>(*I)) + if (isa<ObjCMethodDecl>(I)) continue; - LocalTUDecls.push_back(*I); + LocalTUDecls.push_back(I); } } @@ -462,11 +462,9 @@ SetOfConstDecls Visited; SetOfConstDecls VisitedAsTopLevel; llvm::ReversePostOrderTraversal<clang::CallGraph*> RPOT(&CG); - for (llvm::ReversePostOrderTraversal<clang::CallGraph*>::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.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits