void computeCalleeCallerMapping(DSCallSite CS, const Function &Callee,
DSGraph &CalleeGraph, NodeMapTy &NodeMap);
- /// cloneInto - Clone the specified DSGraph into the current graph. The
- /// translated ScalarMap for the old function is filled into the OldValMap
- /// member, and the translated ReturnNodes map is returned into ReturnNodes.
- /// OldNodeMap contains a mapping from the original nodes to the newly cloned
- /// nodes.
+ /// cloneInto - Clone the specified DSGraph into the current graph.
///
/// The CloneFlags member controls various aspects of the cloning process.
///
- void cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
- unsigned CloneFlags = 0);
+ void cloneInto(const DSGraph &G, unsigned CloneFlags = 0);
/// getFunctionArgumentsForCall - Given a function that is currently in this
/// graph, return the DSNodeHandles that correspond to the pointer-compatible
E = SCCGraphs.end(); I != E; ++I) {
DSGraph &G = **I;
if (&G != SCCGraph) {
- {
- DSGraph::NodeMapTy NodeMap;
- SCCGraph->cloneInto(G, NodeMap);
- }
+ SCCGraph->cloneInto(G);
+
// Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = G.retnodes_begin(),
E = G.retnodes_end(); I != E; ++I)
// If the graph already contains the nodes for the function, don't
// bother merging it in again.
if (!GI->containsFunction(*I)) {
- DSGraph::NodeMapTy NodeMap;
- GI->cloneInto(getDSGraph(**I), NodeMap);
+ GI->cloneInto(getDSGraph(**I));
++NumBUInlines;
}
DSGraph *NG = Stack.back();
ValMap[NG] = ~0U;
- {
- DSGraph::NodeMapTy NodeMap;
- FG.cloneInto(*NG, NodeMap);
- }
+ FG.cloneInto(*NG);
// Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
unsigned CloneFlags)
: GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
PrintAuxCalls = false;
- NodeMapTy NodeMap;
- cloneInto(G, NodeMap, CloneFlags);
+ cloneInto(G, CloneFlags);
}
DSGraph::~DSGraph() {
///
/// The CloneFlags member controls various aspects of the cloning process.
///
-void DSGraph::cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
- unsigned CloneFlags) {
+void DSGraph::cloneInto(const DSGraph &G, unsigned CloneFlags) {
TIME_REGION(X, "cloneInto");
- assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!");
assert(&G != this && "Cannot clone graph into itself!");
+ NodeMapTy OldNodeMap;
+
// Remove alloca or mod/ref bits as specified...
unsigned BitsToClear = ((CloneFlags & StripAllocaBit)? DSNode::AllocaNode : 0)
| ((CloneFlags & StripModRefBits)? (DSNode::Modified | DSNode::Read) : 0)
}
// Clone this member of the equivalence class into MergedG.
- DSGraph::NodeMapTy NodeMap;
- MergedG.cloneInto(CBUGraph, NodeMap);
+ MergedG.cloneInto(CBUGraph);
}
// Merge the return nodes of all functions together.
// If the SCC found is not the same as those found in CBU, make sure to
// merge the graphs as appropriate.
- {
- DSGraph::NodeMapTy NodeMap;
- FG.cloneInto(*NG, NodeMap);
- }
+ FG.cloneInto(*NG);
// Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = NG->retnodes_begin();
// into this graph.
//
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- if (!I->isExternal()) {
- DSGraph::NodeMapTy NodeMap;
- ResultGraph->cloneInto(LDS.getDSGraph(*I), NodeMap, 0);
- }
+ if (!I->isExternal())
+ ResultGraph->cloneInto(LDS.getDSGraph(*I));
ResultGraph->removeTriviallyDeadNodes();