[llvm-commits] [poolalloc] r107164 - /poolalloc/trunk/lib/DSA/DSGraph.cpp
John Criswell
criswell at uiuc.edu
Tue Jun 29 10:17:05 PDT 2010
Author: criswell
Date: Tue Jun 29 12:17:04 2010
New Revision: 107164
URL: http://llvm.org/viewvc/llvm-project?rev=107164&view=rev
Log:
Modified the DSGraph::computeNodeMapping() method so that it passes its
StrictChecking parameter to itself in recursive calls.
Added comments.
Modified:
poolalloc/trunk/lib/DSA/DSGraph.cpp
Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=107164&r1=107163&r2=107164&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSGraph.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSGraph.cpp Tue Jun 29 12:17:04 2010
@@ -1160,9 +1160,28 @@
/// graph may have multiple nodes representing one node in the second graph),
/// but it will not work if there is a one-to-many or many-to-many mapping.
///
+/// Inputs:
+/// @NH1 - The first root value for which a node mapping is
+/// desired. This value can have a NULL DSNode.
+/// @NH2 - The second root value for which a node mapping is
+/// desired. This value can have a NULL DSNode.
+/// @StrictChecking - Flags whether strict sanity checks should be enforced.
+///
+/// Outputs:
+/// @NodeMap - A mapping of DSNodes to DSNode handles providing the node
+/// mapping desired by the caller.
+///
+/// Notes:
+/// FIXME: Why was StrictChecking not passed in the recursive calls?
+/// FIXME: Why isn't StrictChecking always desired?
+///
void DSGraph::computeNodeMapping(const DSNodeHandle &NH1,
const DSNodeHandle &NH2, NodeMapTy &NodeMap,
bool StrictChecking) {
+ //
+ // Get the DSNodes associated with the root values. If either one of them is
+ // NULL, then we are done.
+ //
DSNode *N1 = NH1.getNode(), *N2 = NH2.getNode();
if (N1 == 0 || N2 == 0) return;
@@ -1192,10 +1211,10 @@
// aligned right).
if (!N1NH.isNull()) {
if (unsigned(N2Idx)+i < N2Size)
- computeNodeMapping(N1NH, N2->getLink(N2Idx+i), NodeMap);
+ computeNodeMapping(N1NH, N2->getLink(N2Idx+i), NodeMap, StrictChecking);
else
computeNodeMapping(N1NH,
- N2->getLink(unsigned(N2Idx+i) % N2Size), NodeMap);
+ N2->getLink(unsigned(N2Idx+i) % N2Size), NodeMap, StrictChecking);
}
}
}
More information about the llvm-commits
mailing list