diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-08 22:27:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-08 22:27:09 +0000 |
commit | acf491f0b41a4b044d4e908025de592eb9979e0f (patch) | |
tree | 31d0dd37145f4680bae42c704fb02f6e44d21965 /lib/Analysis/DataStructure | |
parent | ce2d1328fc542e662ab41c64642d2362776840e8 (diff) |
Allow specification of whether the call sites should be copied, AND whether
the aux call sites should be copied
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r-- | lib/Analysis/DataStructure/DataStructure.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index 60a89ffae1..a7653115b8 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -588,9 +588,11 @@ DSNodeHandle DSGraph::cloneInto(const DSGraph &G, FunctionCalls.reserve(FC+G.FunctionCalls.size()); for (unsigned i = 0, ei = G.FunctionCalls.size(); i != ei; ++i) FunctionCalls.push_back(DSCallSite(G.FunctionCalls[i], OldNodeMap)); + } + if (!(CloneFlags & DontCloneAuxCallNodes)) { // Copy the auxillary function calls list... - FC = AuxFunctionCalls.size(); // FirstCall + unsigned FC = AuxFunctionCalls.size(); // FirstCall AuxFunctionCalls.reserve(FC+G.AuxFunctionCalls.size()); for (unsigned i = 0, ei = G.AuxFunctionCalls.size(); i != ei; ++i) AuxFunctionCalls.push_back(DSCallSite(G.AuxFunctionCalls[i], OldNodeMap)); @@ -981,13 +983,20 @@ void DSGraph::removeDeadNodes(bool KeepAllGlobals, bool KeepCalls) { std::set<DSNode*> Alive; // If KeepCalls, mark all nodes reachable by call nodes as alive... - if (KeepCalls) + if (KeepCalls) { for (unsigned i = 0, e = FunctionCalls.size(); i != e; ++i) { for (unsigned j = 0, e = FunctionCalls[i].getNumPtrArgs(); j != e; ++j) markAlive(FunctionCalls[i].getPtrArg(j).getNode(), Alive); markAlive(FunctionCalls[i].getRetVal().getNode(), Alive); markAlive(FunctionCalls[i].getCallee().getNode(), Alive); } + for (unsigned i = 0, e = AuxFunctionCalls.size(); i != e; ++i) { + for (unsigned j = 0, e = AuxFunctionCalls[i].getNumPtrArgs(); j != e; ++j) + markAlive(AuxFunctionCalls[i].getPtrArg(j).getNode(), Alive); + markAlive(AuxFunctionCalls[i].getRetVal().getNode(), Alive); + markAlive(AuxFunctionCalls[i].getCallee().getNode(), Alive); + } + } // Mark all nodes reachable by scalar nodes as alive... for (std::map<Value*, DSNodeHandle>::iterator I = ScalarMap.begin(), |