mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Rangify for loops, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ba74b27ed1
commit
3b50e96994
@ -24,8 +24,8 @@ CallGraph::CallGraph(Module &M)
|
|||||||
: M(M), Root(nullptr), ExternalCallingNode(getOrInsertFunction(nullptr)),
|
: M(M), Root(nullptr), ExternalCallingNode(getOrInsertFunction(nullptr)),
|
||||||
CallsExternalNode(new CallGraphNode(nullptr)) {
|
CallsExternalNode(new CallGraphNode(nullptr)) {
|
||||||
// Add every function to the call graph.
|
// Add every function to the call graph.
|
||||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
|
for (Function &F : M)
|
||||||
addToCallGraph(I);
|
addToCallGraph(&F);
|
||||||
|
|
||||||
// If we didn't find a main function, use the external call graph node
|
// If we didn't find a main function, use the external call graph node
|
||||||
if (!Root)
|
if (!Root)
|
||||||
@ -40,13 +40,11 @@ CallGraph::~CallGraph() {
|
|||||||
// Reset all node's use counts to zero before deleting them to prevent an
|
// Reset all node's use counts to zero before deleting them to prevent an
|
||||||
// assertion from firing.
|
// assertion from firing.
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (FunctionMapTy::iterator I = FunctionMap.begin(), E = FunctionMap.end();
|
for (auto &I : FunctionMap)
|
||||||
I != E; ++I)
|
I.second->allReferencesDropped();
|
||||||
I->second->allReferencesDropped();
|
|
||||||
#endif
|
#endif
|
||||||
for (FunctionMapTy::iterator I = FunctionMap.begin(), E = FunctionMap.end();
|
for (auto &I : FunctionMap)
|
||||||
I != E; ++I)
|
delete I.second;
|
||||||
delete I->second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallGraph::addToCallGraph(Function *F) {
|
void CallGraph::addToCallGraph(Function *F) {
|
||||||
|
Loading…
Reference in New Issue
Block a user