diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-01 20:37:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-01 20:37:00 +0000 |
commit | 77408b8987085aafe968988c5e63cd57a68b799b (patch) | |
tree | be4e4d0d60600f329e9924762630811254192a88 /lib/Analysis/DataStructure | |
parent | 7cc372bfc36669ce4838a85da91b491486fb6a15 (diff) |
Get rid of the EquivClassGraphArgsInfo class, and the map that held it.
We only need one instance of the vector that it contains at a time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r-- | lib/Analysis/DataStructure/EquivClassGraphs.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp index 0e20714b29..1d80b9cb0e 100644 --- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -115,7 +115,7 @@ bool PA::EquivClassGraphs::runOnModule(Module &M) { // void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) { const ActualCalleesTy& AC = CBU->getActualCallees(); - + // Loop over all of the indirect calls in the program. If a call site can // call multiple different functions, we need to unify all of the callees into // the same equivalence class. @@ -196,11 +196,12 @@ void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) { // equivalence graph. DSGraph *mergedG = &getOrCreateGraph(*LF); - // Record the argument nodes for use in merging later below - EquivClassGraphArgsInfo& GraphInfo = getECGraphInfo(mergedG); + // Record the argument nodes for use in merging later below. + std::vector<DSNodeHandle> ArgNodes; + for (Function::aiterator AI1 = LF->abegin(); AI1 != LF->aend(); ++AI1) if (DS::isPointerType(AI1->getType())) - GraphInfo.argNodes.push_back(mergedG->getNodeForValue(AI1)); + ArgNodes.push_back(mergedG->getNodeForValue(AI1)); // Merge in the graphs of all other functions in this equiv. class. Note // that two or more functions may have the same graph, and it only needs @@ -234,14 +235,14 @@ void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) { // Merge the function arguments with all argument nodes found so far. // If there are extra function args, add them to the vector of argNodes Function::aiterator AI2 = F->abegin(), AI2end = F->aend(); - for (unsigned arg=0, numArgs=GraphInfo.argNodes.size(); + for (unsigned arg=0, numArgs = ArgNodes.size(); arg != numArgs && AI2 != AI2end; ++AI2, ++arg) if (DS::isPointerType(AI2->getType())) - GraphInfo.argNodes[arg].mergeWith(mergedG->getNodeForValue(AI2)); + ArgNodes[arg].mergeWith(mergedG->getNodeForValue(AI2)); for ( ; AI2 != AI2end; ++AI2) if (DS::isPointerType(AI2->getType())) - GraphInfo.argNodes.push_back(mergedG->getNodeForValue(AI2)); + ArgNodes.push_back(mergedG->getNodeForValue(AI2)); DEBUG(mergedG->AssertGraphOK()); } } |