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

fijal at codespeak.net fijal at codespeak.net
Fri Oct 26 19:52:09 CEST 2007


Author: fijal
Date: Fri Oct 26 19:52:09 2007
New Revision: 48089

Modified:
   pypy/dist/pypy/translator/c/database.py
   pypy/dist/pypy/translator/c/external.py
   pypy/dist/pypy/translator/c/genc.py
Log:
Fix a bit translator/c to call prepare_inline_helpers


Modified: pypy/dist/pypy/translator/c/database.py
==============================================================================
--- pypy/dist/pypy/translator/c/database.py	(original)
+++ pypy/dist/pypy/translator/c/database.py	Fri Oct 26 19:52:09 2007
@@ -392,3 +392,11 @@
             for graph in node.graphs_to_patch():
                 graphs.append(graph)
         self.gctransformer.prepare_inline_helpers(graphs)
+
+    def all_graphs(self):
+        graphs = []
+        for node in self.containerlist:
+            if node.nodekind == 'func':
+                for graph in node.graphs_to_patch():
+                    graphs.append(graph)
+        return graphs

Modified: pypy/dist/pypy/translator/c/external.py
==============================================================================
--- pypy/dist/pypy/translator/c/external.py	(original)
+++ pypy/dist/pypy/translator/c/external.py	Fri Oct 26 19:52:09 2007
@@ -15,6 +15,9 @@
         self.argtypenames = [db.gettype(T) for T in self.FUNCTYPE.ARGS]
         self.resulttypename = db.gettype(self.FUNCTYPE.RESULT)
 
+    def graphs_to_patch(self):
+        return []
+
     def name(self, cname):  #virtual
         return cname
 

Modified: pypy/dist/pypy/translator/c/genc.py
==============================================================================
--- pypy/dist/pypy/translator/c/genc.py	(original)
+++ pypy/dist/pypy/translator/c/genc.py	Fri Oct 26 19:52:09 2007
@@ -173,11 +173,7 @@
         # actually generating the source.
         if db is None:
             db = self.build_database()
-        graphs = []
-        for node in db.containerlist:
-            if isinstance(node, FuncNode):
-                for graph in node.graphs_to_patch():
-                    graphs.append(graph)
+        graphs = db.all_graphs()
         db.gctransformer.prepare_inline_helpers(graphs)
         for node in db.containerlist:
             if isinstance(node, FuncNode):
@@ -596,6 +592,8 @@
     print >> f, '#include "src/g_include.h"'
     print >> f
     blank = True
+    graphs = database.all_graphs()
+    database.gctransformer.prepare_inline_helpers(graphs)
     for node in database.globalcontainers():
         if blank:
             print >> f



More information about the Pypy-commit mailing list