now that the second argument is always this->ReturnNodes, don't bother passing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20758 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-03-22 00:29:44 +00:00
parent 560af8aa97
commit d65145bd3d
6 changed files with 19 additions and 18 deletions

View File

@@ -454,8 +454,7 @@ public:
/// ///
/// 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, void cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap,
unsigned CloneFlags = 0); unsigned CloneFlags = 0);
/// getFunctionArgumentsForCall - Given a function that is currently in this /// getFunctionArgumentsForCall - Given a function that is currently in this

View File

@@ -269,7 +269,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F,
if (&G != SCCGraph) { if (&G != SCCGraph) {
{ {
DSGraph::NodeMapTy NodeMap; DSGraph::NodeMapTy NodeMap;
SCCGraph->cloneInto(G, SCCGraph->getReturnNodes(), 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(),
@@ -413,7 +413,7 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
// bother merging it in again. // bother merging it in again.
if (!GI->containsFunction(*I)) { if (!GI->containsFunction(*I)) {
DSGraph::NodeMapTy NodeMap; DSGraph::NodeMapTy NodeMap;
GI->cloneInto(getDSGraph(**I), GI->getReturnNodes(), NodeMap); GI->cloneInto(getDSGraph(**I), NodeMap);
++NumBUInlines; ++NumBUInlines;
} }

View File

@@ -175,8 +175,10 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
DSGraph *NG = Stack.back(); DSGraph *NG = Stack.back();
ValMap[NG] = ~0U; ValMap[NG] = ~0U;
DSGraph::NodeMapTy NodeMap; {
FG.cloneInto(*NG, FG.getReturnNodes(), NodeMap); 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

@@ -1169,14 +1169,14 @@ DSGraph::DSGraph(const DSGraph &G, EquivalenceClasses<GlobalValue*> &ECs,
: GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) { : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
PrintAuxCalls = false; PrintAuxCalls = false;
NodeMapTy NodeMap; NodeMapTy NodeMap;
cloneInto(G, ReturnNodes, NodeMap, CloneFlags); cloneInto(G, NodeMap, CloneFlags);
} }
DSGraph::DSGraph(const DSGraph &G, NodeMapTy &NodeMap, DSGraph::DSGraph(const DSGraph &G, NodeMapTy &NodeMap,
EquivalenceClasses<GlobalValue*> &ECs) EquivalenceClasses<GlobalValue*> &ECs)
: GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) { : GlobalsGraph(0), ScalarMap(ECs), TD(G.TD) {
PrintAuxCalls = false; PrintAuxCalls = false;
cloneInto(G, ReturnNodes, NodeMap); cloneInto(G, NodeMap);
} }
DSGraph::~DSGraph() { DSGraph::~DSGraph() {
@@ -1242,8 +1242,7 @@ 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, void DSGraph::cloneInto(const DSGraph &G, NodeMapTy &OldNodeMap,
ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap,
unsigned CloneFlags) { unsigned CloneFlags) {
TIME_REGION(X, "cloneInto"); TIME_REGION(X, "cloneInto");
assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!"); assert(OldNodeMap.empty() && "Returned OldNodeMap should be empty!");
@@ -1306,9 +1305,9 @@ void DSGraph::cloneInto(const DSGraph &G,
const DSNodeHandle &Ret = I->second; const DSNodeHandle &Ret = I->second;
DSNodeHandle &MappedRet = OldNodeMap[Ret.getNode()]; DSNodeHandle &MappedRet = OldNodeMap[Ret.getNode()];
DSNode *MappedRetN = MappedRet.getNode(); DSNode *MappedRetN = MappedRet.getNode();
OldReturnNodes.insert(std::make_pair(I->first, ReturnNodes.insert(std::make_pair(I->first,
DSNodeHandle(MappedRetN, DSNodeHandle(MappedRetN,
MappedRet.getOffset()+Ret.getOffset()))); MappedRet.getOffset()+Ret.getOffset())));
} }
} }

View File

@@ -271,7 +271,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; DSGraph::NodeMapTy NodeMap;
MergedG.cloneInto(CBUGraph, MergedG.getReturnNodes(), NodeMap, 0); MergedG.cloneInto(CBUGraph, NodeMap);
} }
// Merge the return nodes of all functions together. // Merge the return nodes of all functions together.
@@ -362,8 +362,10 @@ 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.
DSGraph::NodeMapTy NodeMap; {
FG.cloneInto(*NG, FG.getReturnNodes(), NodeMap); 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

@@ -125,8 +125,7 @@ bool Steens::runOnModule(Module &M) {
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; DSGraph::NodeMapTy NodeMap;
ResultGraph->cloneInto(LDS.getDSGraph(*I), ResultGraph->getReturnNodes(), ResultGraph->cloneInto(LDS.getDSGraph(*I), NodeMap, 0);
NodeMap, 0);
} }
ResultGraph->removeTriviallyDeadNodes(); ResultGraph->removeTriviallyDeadNodes();