diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-14 19:22:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-14 19:22:47 +0000 |
commit | b2b17bb65b0271709cc20265e1467ab39782f2ee (patch) | |
tree | 0c913578d95da72b1860f0b2b0507669f16e8cda /lib/Analysis/DataStructure/DataStructure.cpp | |
parent | 62b2b22573e921ce008b687aa3dcc56ad06fd02f (diff) |
add a method to compute a commonly used mapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/DataStructure.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index 212e11829a..1e47203f42 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -2082,3 +2082,16 @@ void DSGraph::computeNodeMapping(const DSNodeHandle &NH1, computeNodeMapping(N1->getLink(i), N2->getLink(unsigned(N2Idx+i) % N2Size), NodeMap); } + + +/// computeGlobalGraphMapping - Compute the mapping of nodes in the global +/// graph to nodes in this graph. +void DSGraph::computeGlobalGraphMapping(NodeMapTy &NodeMap) { + DSGraph &GG = *getGlobalsGraph(); + + DSScalarMap &SM = getScalarMap(); + for (DSScalarMap::global_iterator I = SM.global_begin(), + E = SM.global_end(); I != E; ++I) + DSGraph::computeNodeMapping(SM[*I], GG.getNodeForValue(*I), NodeMap); +} + |