[pypy-svn] r76006 - pypy/trunk/pypy/jit/codewriter

fijal at codespeak.net fijal at codespeak.net
Thu Jul 8 09:37:57 CEST 2010


Author: fijal
Date: Thu Jul  8 09:37:55 2010
New Revision: 76006

Modified:
   pypy/trunk/pypy/jit/codewriter/codewriter.py
Log:
Only print code if debug is on


Modified: pypy/trunk/pypy/jit/codewriter/codewriter.py
==============================================================================
--- pypy/trunk/pypy/jit/codewriter/codewriter.py	(original)
+++ pypy/trunk/pypy/jit/codewriter/codewriter.py	Thu Jul  8 09:37:55 2010
@@ -14,11 +14,12 @@
 class CodeWriter(object):
     callcontrol = None    # for tests
 
-    def __init__(self, cpu=None, jitdrivers_sd=[]):
+    def __init__(self, cpu=None, jitdrivers_sd=[], debug=False):
         self.cpu = cpu
         self.assembler = Assembler()
         self.callcontrol = CallControl(cpu, jitdrivers_sd)
         self._seen_files = set()
+        self.debug = debug
 
     def transform_func_to_jitcode(self, func, values, type_system='lltype'):
         """For testing."""
@@ -60,7 +61,8 @@
         self.assembler.assemble(ssarepr, jitcode)
         #
         # print the resulting assembler
-        self.print_ssa_repr(ssarepr, portal_jd, verbose)
+        if self.debug:
+            self.print_ssa_repr(ssarepr, portal_jd, verbose)
 
     def make_jitcodes(self, verbose=False):
         log.info("making JitCodes...")



More information about the Pypy-commit mailing list