Add support for enumerated settings.

The EnumSetting objects can take one of 256 named values.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-09 14:12:36 -07:00
parent 07e851a222
commit 1ef72dd5ec
4 changed files with 127 additions and 16 deletions

View File

@@ -4,10 +4,22 @@ Cretonne shared settings.
This module defines settings are are relevant for all code generators.
"""
from . import SettingGroup, BoolSetting
from . import SettingGroup, BoolSetting, EnumSetting
group = SettingGroup('shared')
enable_simd = BoolSetting("Enable the use of SIMD instructions", default=True)
opt_level = EnumSetting(
"""
Optimization level:
- default: Very profitable optimizations enabled, none slow.
- best: Enable all optimizations
- fastest: Optimize for compile time by disabling most optimizations.
""",
'default', 'best', 'fastest')
enable_simd = BoolSetting(
"""Enable the use of SIMD instructions.""",
default=True)
group.close(globals())