[pypy-svn] r50768 - pypy/dist/pypy/translator/c

xoraxax at codespeak.net xoraxax at codespeak.net
Sat Jan 19 00:34:28 CET 2008


Author: xoraxax
Date: Sat Jan 19 00:34:27 2008
New Revision: 50768

Modified:
   pypy/dist/pypy/translator/c/database.py
Log:
Do not only sort the struct def nodes topologically, but also by name.

Modified: pypy/dist/pypy/translator/c/database.py
==============================================================================
--- pypy/dist/pypy/translator/c/database.py	(original)
+++ pypy/dist/pypy/translator/c/database.py	Sat Jan 19 00:34:27 2008
@@ -363,11 +363,15 @@
         seen = {}
         def produce(node):
             if node not in seen:
-                for othernode in node.dependencies:
+                deps = node.dependencies.keys()
+                deps.sort(key=lambda x: x.name)
+                for othernode in deps:
                     produce(othernode)
                 result.append(node)
                 seen[node] = True
-        for node in self.structdefnodes.values():
+        nodes = self.structdefnodes.values()
+        nodes.sort(key=lambda x: x.name)
+        for node in nodes:
             produce(node)
         return result
 



More information about the Pypy-commit mailing list