[pypy-commit] pypy default: Add translation option --hash=siphash24
arigo
pypy.commits at gmail.com
Thu Jan 26 03:30:50 EST 2017
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r89776:ccc88590dc02
Date: 2017-01-26 09:30 +0100
http://bitbucket.org/pypy/pypy/changeset/ccc88590dc02/
Log: Add translation option --hash=siphash24
diff --git a/rpython/config/translationoption.py b/rpython/config/translationoption.py
--- a/rpython/config/translationoption.py
+++ b/rpython/config/translationoption.py
@@ -201,6 +201,10 @@
StrOption("icon", "Path to the (Windows) icon to use for the executable"),
StrOption("libname",
"Windows: name and possibly location of the lib file to create"),
+ ChoiceOption("hash",
+ "The hash to use for strings",
+ ["rpython", "siphash24"],
+ default="rpython", cmdline="--hash"),
OptionDescription("backendopt", "Backend Optimization Options", [
# control inlining
@@ -390,6 +394,12 @@
if sys.platform == "darwin" or sys.platform =="win32":
raise ConfigError("'asmgcc' not supported on this platform")
+def apply_extra_settings(config):
+ # make the setting of config.hash definitive
+ from rpython.rlib.objectmodel import set_hash_algorithm
+ config.translation.hash = config.translation.hash
+ set_hash_algorithm(config.translation.hash)
+
# ----------------------------------------------------------------
def set_platform(config):
diff --git a/rpython/translator/goal/translate.py b/rpython/translator/goal/translate.py
--- a/rpython/translator/goal/translate.py
+++ b/rpython/translator/goal/translate.py
@@ -11,7 +11,8 @@
from rpython.config.config import (to_optparse, OptionDescription, BoolOption,
ArbitraryOption, StrOption, IntOption, Config, ChoiceOption, OptHelpFormatter)
from rpython.config.translationoption import (get_combined_translation_config,
- set_opt_level, OPT_LEVELS, DEFAULT_OPT_LEVEL, set_platform, CACHE_DIR)
+ set_opt_level, OPT_LEVELS, DEFAULT_OPT_LEVEL, set_platform, CACHE_DIR,
+ apply_extra_settings)
# clean up early rpython/_cache
try:
@@ -177,6 +178,9 @@
if 'handle_config' in targetspec_dic:
targetspec_dic['handle_config'](config, translateconfig)
+ # apply extra settings
+ apply_extra_settings(config)
+
return targetspec_dic, translateconfig, config, args
def show_help(translateconfig, opt_parser, targetspec_dic, config):
More information about the pypy-commit
mailing list