Esempio n. 1
0
                   default=False,
                   cmdline=None),
        ChoiceOption("fork_before",
                     "(UNIX) Create restartable checkpoint before step", [
                         "annotate", "rtype", "backendopt", "database",
                         "source", "pyjitpl"
                     ],
                     default=None,
                     cmdline="--fork-before"),
        BoolOption(
            "dont_write_c_files",
            "Make the C backend write everyting to /dev/null. " +
            "Useful for benchmarking, so you don't actually involve the disk",
            default=False,
            cmdline="--dont-write-c-files"),
        ArbitraryOption("instrumentctl", "internal", default=None),
        StrOption("output", "Output file name", cmdline="--output"),
        StrOption(
            "secondaryentrypoints",
            "Comma separated list of keys choosing secondary entrypoints",
            cmdline="--entrypoints",
            default="main"),
        BoolOption("dump_static_data_info",
                   "Dump static data info",
                   cmdline="--dump_static_data_info",
                   default=False,
                   requires=[("translation.backend", "c")]),

        # portability options
        BoolOption("no__thread",
                   "don't use __thread for implementing TLS",
Esempio n. 2
0
        BoolOption("view",
                   "Start the pygame viewer",
                   default=False,
                   cmdline="--view",
                   negation=False),
        BoolOption("help",
                   "show this help message and exit",
                   default=False,
                   cmdline="-h --help",
                   negation=False),
        BoolOption("fullhelp",
                   "show full help message and exit",
                   default=False,
                   cmdline="--full-help",
                   negation=False),
        ArbitraryOption("goals", "XXX", defaultfactory=list),
        # xxx default goals ['annotate', 'rtype', 'backendopt', 'source', 'compile']
        ArbitraryOption("skipped_goals", "XXX", defaultfactory=list),
        OptionDescription("goal_options",
                          "Goals that should be reached during translation",
                          goal_options()),
    ])

import optparse
from rpython.tool.ansi_print import AnsiLogger
log = AnsiLogger("translation")


def load_target(targetspec):
    log.info("Translating target as defined by %s" % targetspec)
    if not targetspec.endswith('.py'):