[pypy-svn] r9028 - pypy/dist/pypy/translator

pedronis at codespeak.net pedronis at codespeak.net
Wed Feb 9 14:00:32 CET 2005


Author: pedronis
Date: Wed Feb  9 14:00:32 2005
New Revision: 9028

Modified:
   pypy/dist/pypy/translator/translator.py
Log:
do not force to specify an entrypoint up front



Modified: pypy/dist/pypy/translator/translator.py
==============================================================================
--- pypy/dist/pypy/translator/translator.py	(original)
+++ pypy/dist/pypy/translator/translator.py	Wed Feb  9 14:00:32 2005
@@ -45,7 +45,7 @@
 
 class Translator:
 
-    def __init__(self, func, verbose=False, simplifying=False):
+    def __init__(self, func=None, verbose=False, simplifying=False):
         self.entrypoint = func
         self.verbose = verbose
         self.simplifying = simplifying
@@ -58,7 +58,8 @@
         self.functions = []   # the keys of self.flowgraphs, in creation order
         self.callgraph = {}   # {opaque_tag: (caller, callee)}
         self.frozen = False   # when frozen, no more flowgraphs can be generated
-        self.getflowgraph()
+        if self.entrypoint:
+            self.getflowgraph()
 
     def getflowgraph(self, func=None, called_by=None, call_tag=None):
         """Get the flow graph for a function (default: the entry point)."""



More information about the Pypy-commit mailing list