mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
*** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2959 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d99d4d7b70
commit
f0cd4722bf
@ -29,9 +29,10 @@ static bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) {
|
||||
std::vector<CallGraphNode*> FunctionsToDelete; // Track unused functions
|
||||
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
|
||||
CallGraphNode *N = CallGraph[I];
|
||||
|
||||
if (!ReachableNodes.count(N)) { // Not reachable??
|
||||
I->dropAllReferences();
|
||||
N->removeAllCalledMethods();
|
||||
N->removeAllCalledFunctions();
|
||||
FunctionsToDelete.push_back(N);
|
||||
++NumRemoved;
|
||||
}
|
||||
@ -45,7 +46,7 @@ static bool RemoveUnreachableFunctions(Module &M, CallGraph &CallGraph) {
|
||||
//
|
||||
for (std::vector<CallGraphNode*>::iterator I = FunctionsToDelete.begin(),
|
||||
E = FunctionsToDelete.end(); I != E; ++I)
|
||||
delete CallGraph.removeMethodFromModule(*I);
|
||||
delete CallGraph.removeFunctionFromModule(*I);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user