[pypy-commit] pypy default: Add the '--opt=..' option to py.py, as a way to enable all pypy-specific

arigo noreply at buildbot.pypy.org
Wed Oct 31 17:06:37 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r58644:2d138f334c76
Date: 2012-10-31 17:06 +0100
http://bitbucket.org/pypy/pypy/changeset/2d138f334c76/

Log:	Add the '--opt=..' option to py.py, as a way to enable all pypy-
	specific options at a certain optimization level.

diff --git a/pypy/bin/py.py b/pypy/bin/py.py
--- a/pypy/bin/py.py
+++ b/pypy/bin/py.py
@@ -65,10 +65,17 @@
     config, parser = option.get_standard_options()
     interactiveconfig = Config(cmdline_optiondescr)
     to_optparse(interactiveconfig, parser=parser)
+    def set_family_of_options(option, opt, value, parser):
+        from pypy.config.pypyoption import set_pypy_opt_level
+        set_pypy_opt_level(config, value)
     parser.add_option(
         '--cc', type=str, action="callback",
         callback=set_compiler,
         help="Compiler to use for compiling generated C")
+    parser.add_option(
+        '--opt', type=str, action="callback",
+        callback=set_family_of_options,
+        help="Set the family of options based on -opt=0,1,2,jit...")
     args = option.process_options(parser, argv[1:])
     if interactiveconfig.verbose:
         error.RECORD_INTERPLEVEL_TRACEBACK = True


More information about the pypy-commit mailing list