summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraph.cpp
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-06-12 05:15:27 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-06-12 05:15:27 +0000
commit26ceb0845ba0fef388fd322ce71f5a96c19e7fc9 (patch)
tree2522cb3bfd1220028bea31be41075d3ac5bf210f /llvm/lib/Analysis/IPA/CallGraph.cpp
parent216c9cdb1d159e22588b18fa5156218a5e051ba2 (diff)
downloadbcm5719-llvm-26ceb0845ba0fef388fd322ce71f5a96c19e7fc9.tar.gz
bcm5719-llvm-26ceb0845ba0fef388fd322ce71f5a96c19e7fc9.zip
Rangify for loops, NFC.
llvm-svn: 239596
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 67cf7f86e07..ee276393964 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -24,8 +24,8 @@ CallGraph::CallGraph(Module &M)
: M(M), Root(nullptr), ExternalCallingNode(getOrInsertFunction(nullptr)),
CallsExternalNode(new CallGraphNode(nullptr)) {
// Add every function to the call graph.
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- addToCallGraph(I);
+ for (Function &F : M)
+ addToCallGraph(&F);
// If we didn't find a main function, use the external call graph node
if (!Root)
@@ -40,13 +40,11 @@ CallGraph::~CallGraph() {
// Reset all node's use counts to zero before deleting them to prevent an
// assertion from firing.
#ifndef NDEBUG
- for (FunctionMapTy::iterator I = FunctionMap.begin(), E = FunctionMap.end();
- I != E; ++I)
- I->second->allReferencesDropped();
+ for (auto &I : FunctionMap)
+ I.second->allReferencesDropped();
#endif
- for (FunctionMapTy::iterator I = FunctionMap.begin(), E = FunctionMap.end();
- I != E; ++I)
- delete I->second;
+ for (auto &I : FunctionMap)
+ delete I.second;
}
void CallGraph::addToCallGraph(Function *F) {
OpenPOWER on IntegriCloud