TPL_HOLDER_MACRO_ATTR_DEF = " {type} {name} = {default};\\\n"
TPL_HOLDER_MACRO_ATTR_DEF += " bool {name}__setByUser__ = false;"
+TPL_NAME_DECL = 'static constexpr const char* {name}__name = "{long_name}";'
+
TPL_OPTION_STRUCT_RW = \
"""extern struct {name}__option_t
{{
typedef {type} type;
type operator()() const;
- static constexpr const char* name = "{long_name}";
}} thread_local {name};"""
TPL_DECL_SET = \
# *_options.h
includes = set()
holder_specs = []
+ option_names = []
decls = []
specs = []
inls = []
else:
long_name = ""
decls.append(tpl_decl.format(name=option.name, type=option.type, long_name = long_name))
+ option_names.append(TPL_NAME_DECL.format(name=option.name, type=option.type, long_name = long_name))
# Generate module specialization
specs.append(TPL_DECL_SET.format(name=option.name))
id_cap=module.id_cap,
id=module.id,
includes='\n'.join(sorted(list(includes))),
- holder_spec=' \\\n'.join(holder_specs),
+ holder_spec='\n'.join(holder_specs),
decls='\n'.join(decls),
specs='\n'.join(specs),
+ option_names='\n'.join(option_names),
inls='\n'.join(inls),
modes=''.join(mode_decl)))
std::string opt = option.substr(2);
if (value)
{
- if (opt == options::statisticsAll.name)
+ if (option == options::base::statisticsAll__name)
{
d_options->base().statistics = true;
}
- else if (opt == options::statisticsEveryQuery.name)
+ else if (option == options::base::statisticsEveryQuery__name)
{
d_options->base().statistics = true;
}
- else if (opt == options::statisticsExpert.name)
+ else if (option == options::base::statisticsExpert__name)
{
d_options->base().statistics = true;
}
}
else
{
- if (opt == options::statistics.name)
+ if (option == options::base::statistics__name)
{
d_options->base().statisticsAll = false;
d_options->base().statisticsEveryQuery = false;
// set options that must take effect immediately
if (opts->wasSetByUser(options::defaultExprDepth))
{
- notifySetOption(options::defaultExprDepth.name);
+ notifySetOption(options::expr::defaultExprDepth__name);
}
if (opts->wasSetByUser(options::defaultDagThresh))
{
- notifySetOption(options::defaultDagThresh.name);
+ notifySetOption(options::expr::defaultDagThresh__name);
}
if (opts->wasSetByUser(options::dumpModeString))
{
- notifySetOption(options::dumpModeString.name);
+ notifySetOption(options::smt::dumpModeString__name);
}
if (opts->wasSetByUser(options::printSuccess))
{
- notifySetOption(options::printSuccess.name);
+ notifySetOption(options::base::printSuccess__name);
}
if (opts->wasSetByUser(options::diagnosticChannelName))
{
- notifySetOption(options::diagnosticChannelName.name);
+ notifySetOption(options::smt::diagnosticChannelName__name);
}
if (opts->wasSetByUser(options::regularChannelName))
{
- notifySetOption(options::regularChannelName.name);
+ notifySetOption(options::smt::regularChannelName__name);
}
if (opts->wasSetByUser(options::dumpToFileName))
{
- notifySetOption(options::dumpToFileName.name);
+ notifySetOption(options::smt::dumpToFileName__name);
}
// set this as a listener to be notified of options changes from now on
opts->setListener(this);
{
Trace("smt") << "SmtEnginePrivate::notifySetOption(" << key << ")"
<< std::endl;
- if (key == options::defaultExprDepth.name)
+ if (key == options::expr::defaultExprDepth__name)
{
int depth = (*d_options)[options::defaultExprDepth];
Debug.getStream() << expr::ExprSetDepth(depth);
Warning.getStream() << expr::ExprSetDepth(depth);
// intentionally exclude Dump stream from this list
}
- else if (key == options::defaultDagThresh.name)
+ else if (key == options::expr::defaultDagThresh__name)
{
int dag = (*d_options)[options::defaultDagThresh];
Debug.getStream() << expr::ExprDag(dag);
Warning.getStream() << expr::ExprDag(dag);
Dump.getStream() << expr::ExprDag(dag);
}
- else if (key == options::dumpModeString.name)
+ else if (key == options::smt::dumpModeString__name)
{
const std::string& value = (*d_options)[options::dumpModeString];
Dump.setDumpFromString(value);
}
- else if (key == options::printSuccess.name)
+ else if (key == options::base::printSuccess__name)
{
bool value = (*d_options)[options::printSuccess];
Debug.getStream() << Command::printsuccess(value);
Warning.getStream() << Command::printsuccess(value);
*options::out() << Command::printsuccess(value);
}
- else if (key == options::regularChannelName.name)
+ else if (key == options::smt::regularChannelName__name)
{
d_managedRegularChannel.set(options::regularChannelName());
}
- else if (key == options::diagnosticChannelName.name)
+ else if (key == options::smt::diagnosticChannelName__name)
{
d_managedDiagnosticChannel.set(options::diagnosticChannelName());
}
- else if (key == options::dumpToFileName.name)
+ else if (key == options::smt::dumpToFileName__name)
{
d_managedDumpChannel.set(options::dumpToFileName());
}