Now that the dead ctor is gone, nothing uses the old node mapping exported by

cloneInto: make it an internally used mapping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-03-22 00:36:51 +00:00
parent 5805c426dc
commit a2197139b5
6 changed files with 14 additions and 32 deletions

View File

@ -444,16 +444,11 @@ public:
void computeCalleeCallerMapping(DSCallSite CS, const Function &Callee, void computeCalleeCallerMapping(DSCallSite CS, const Function &Callee,
DSGraph &CalleeGraph, NodeMapTy &NodeMap); DSGraph &CalleeGraph, NodeMapTy &NodeMap);
/// cloneInto - Clone the specified DSGraph into the current graph. The /// cloneInto - Clone the specified DSGraph into the current graph.
/// 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.
/// ///
/// The CloneFlags member controls various aspects of the cloning process. /// The CloneFlags member controls various aspects of the cloning process.
/// ///
void cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap, void cloneInto(const DSGraph &G, unsigned CloneFlags = 0);
unsigned CloneFlags = 0);
/// getFunctionArgumentsForCall - Given a function that is currently in this /// getFunctionArgumentsForCall - Given a function that is currently in this
/// graph, return the DSNodeHandles that correspond to the pointer-compatible /// graph, return the DSNodeHandles that correspond to the pointer-compatible

View File

@ -267,10 +267,8 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
E = SCCGraphs.end(); I != E; ++I) { E = SCCGraphs.end(); I != E; ++I) {
DSGraph &G = **I; DSGraph &G = **I;
if (&G != SCCGraph) { if (&G != SCCGraph) {
{ SCCGraph->cloneInto(G);
DSGraph::NodeMapTy NodeMap;
SCCGraph->cloneInto(G, NodeMap);
}
// Update the DSInfo map and delete the old graph... // Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = G.retnodes_begin(), for (DSGraph::retnodes_iterator I = G.retnodes_begin(),
E = G.retnodes_end(); I != E; ++I) E = G.retnodes_end(); I != E; ++I)
@ -412,8 +410,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
// If the graph already contains the nodes for the function, don't // If the graph already contains the nodes for the function, don't
// bother merging it in again. // bother merging it in again.
if (!GI->containsFunction(*I)) { if (!GI->containsFunction(*I)) {
DSGraph::NodeMapTy NodeMap; GI->cloneInto(getDSGraph(**I));
GI->cloneInto(getDSGraph(**I), NodeMap);
++NumBUInlines; ++NumBUInlines;
} }

View File

@ -175,10 +175,7 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
DSGraph *NG = Stack.back(); DSGraph *NG = Stack.back();
ValMap[NG] = ~0U; ValMap[NG] = ~0U;
{ FG.cloneInto(*NG);
DSGraph::NodeMapTy NodeMap;
FG.cloneInto(*NG, NodeMap);
}
// Update the DSInfo map and delete the old graph... // Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = NG->retnodes_begin(); for (DSGraph::retnodes_iterator I = NG->retnodes_begin();

View File

@ -1168,8 +1168,7 @@ DSGraph::DSGraph(const DSGraph &G, EquivalenceClasses<GlobalValue*> &ECs,
unsigned CloneFlags) unsigned CloneFlags)
: GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) { : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
PrintAuxCalls = false; PrintAuxCalls = false;
NodeMapTy NodeMap; cloneInto(G, CloneFlags);
cloneInto(G, NodeMap, CloneFlags);
} }
DSGraph::~DSGraph() { DSGraph::~DSGraph() {
@ -1235,12 +1234,12 @@ DSNode *DSGraph::addObjectToGraph(Value *Ptr, bool UseDeclaredType) {
/// ///
/// The CloneFlags member controls various aspects of the cloning process. /// The CloneFlags member controls various aspects of the cloning process.
/// ///
void DSGraph::cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap, void DSGraph::cloneInto(const DSGraph &G, unsigned CloneFlags) {
unsigned CloneFlags) {
TIME_REGION(X, "cloneInto"); TIME_REGION(X, "cloneInto");
assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!");
assert(&G != this && "Cannot clone graph into itself!"); assert(&G != this && "Cannot clone graph into itself!");
NodeMapTy OldNodeMap;
// Remove alloca or mod/ref bits as specified... // Remove alloca or mod/ref bits as specified...
unsigned BitsToClear = ((CloneFlags & StripAllocaBit)? DSNode::AllocaNode : 0) unsigned BitsToClear = ((CloneFlags & StripAllocaBit)? DSNode::AllocaNode : 0)
| ((CloneFlags & StripModRefBits)? (DSNode::Modified | DSNode::Read) : 0) | ((CloneFlags & StripModRefBits)? (DSNode::Modified | DSNode::Read) : 0)

View File

@ -270,8 +270,7 @@ void EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
} }
// Clone this member of the equivalence class into MergedG. // Clone this member of the equivalence class into MergedG.
DSGraph::NodeMapTy NodeMap; MergedG.cloneInto(CBUGraph);
MergedG.cloneInto(CBUGraph, NodeMap);
} }
// Merge the return nodes of all functions together. // Merge the return nodes of all functions together.
@ -362,10 +361,7 @@ processSCC(DSGraph &FG, std::vector<DSGraph*> &Stack, unsigned &NextID,
// If the SCC found is not the same as those found in CBU, make sure to // If the SCC found is not the same as those found in CBU, make sure to
// merge the graphs as appropriate. // merge the graphs as appropriate.
{ FG.cloneInto(*NG);
DSGraph::NodeMapTy NodeMap;
FG.cloneInto(*NG, NodeMap);
}
// Update the DSInfo map and delete the old graph... // Update the DSInfo map and delete the old graph...
for (DSGraph::retnodes_iterator I = NG->retnodes_begin(); for (DSGraph::retnodes_iterator I = NG->retnodes_begin();

View File

@ -123,10 +123,8 @@ bool Steens::runOnModule(Module &M) {
// into this graph. // into this graph.
// //
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (!I->isExternal()) { if (!I->isExternal())
DSGraph::NodeMapTy NodeMap; ResultGraph->cloneInto(LDS.getDSGraph(*I));
ResultGraph->cloneInto(LDS.getDSGraph(*I), NodeMap, 0);
}
ResultGraph->removeTriviallyDeadNodes(); ResultGraph->removeTriviallyDeadNodes();