mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] User timeout option
This commit is contained in:
@@ -147,6 +147,7 @@ static string const g_strMetadata = "metadata";
|
||||
static string const g_strMetadataHash = "metadata-hash";
|
||||
static string const g_strMetadataLiteral = "metadata-literal";
|
||||
static string const g_strModelCheckerEngine = "model-checker-engine";
|
||||
static string const g_strModelCheckerTimeout = "model-checker-timeout";
|
||||
static string const g_strNatspecDev = "devdoc";
|
||||
static string const g_strNatspecUser = "userdoc";
|
||||
static string const g_strNone = "none";
|
||||
@@ -217,6 +218,7 @@ static string const g_argMetadata = g_strMetadata;
|
||||
static string const g_argMetadataHash = g_strMetadataHash;
|
||||
static string const g_argMetadataLiteral = g_strMetadataLiteral;
|
||||
static string const g_argModelCheckerEngine = g_strModelCheckerEngine;
|
||||
static string const g_argModelCheckerTimeout = g_strModelCheckerTimeout;
|
||||
static string const g_argNatspecDev = g_strNatspecDev;
|
||||
static string const g_argNatspecUser = g_strNatspecUser;
|
||||
static string const g_argOpcodes = g_strOpcodes;
|
||||
@@ -1002,6 +1004,13 @@ General Information)").c_str(),
|
||||
po::value<string>()->value_name("all,bmc,chc,none")->default_value("all"),
|
||||
"Select model checker engine."
|
||||
)
|
||||
(
|
||||
g_strModelCheckerTimeout.c_str(),
|
||||
po::value<unsigned>()->value_name("ms"),
|
||||
"Set model checker timeout per query in milliseconds. "
|
||||
"The default is a deterministic resource limit. "
|
||||
"A timeout of 0 means no resource/time restrictions for any query."
|
||||
)
|
||||
;
|
||||
desc.add(smtCheckerOptions);
|
||||
|
||||
@@ -1400,9 +1409,12 @@ bool CommandLineInterface::processInput()
|
||||
serr() << "Invalid option for --" << g_argModelCheckerEngine << ": " << engineStr << endl;
|
||||
return false;
|
||||
}
|
||||
m_modelCheckerEngine = *engine;
|
||||
m_modelCheckerSettings.engine = *engine;
|
||||
}
|
||||
|
||||
if (m_args.count(g_argModelCheckerTimeout))
|
||||
m_modelCheckerSettings.timeout = m_args[g_argModelCheckerTimeout].as<unsigned>();
|
||||
|
||||
m_compiler = make_unique<CompilerStack>(fileReader);
|
||||
|
||||
unique_ptr<SourceReferenceFormatter> formatter;
|
||||
@@ -1417,8 +1429,8 @@ bool CommandLineInterface::processInput()
|
||||
m_compiler->useMetadataLiteralSources(true);
|
||||
if (m_args.count(g_argMetadataHash))
|
||||
m_compiler->setMetadataHash(m_metadataHash);
|
||||
if (m_args.count(g_argModelCheckerEngine))
|
||||
m_compiler->setModelCheckerEngine(m_modelCheckerEngine);
|
||||
if (m_args.count(g_argModelCheckerEngine) || m_args.count(g_argModelCheckerTimeout))
|
||||
m_compiler->setModelCheckerSettings(m_modelCheckerSettings);
|
||||
if (m_args.count(g_argInputFile))
|
||||
m_compiler->setRemappings(m_remappings);
|
||||
|
||||
|
||||
@@ -133,8 +133,8 @@ private:
|
||||
RevertStrings m_revertStrings = RevertStrings::Default;
|
||||
/// Chosen hash method for the bytecode metadata.
|
||||
CompilerStack::MetadataHash m_metadataHash = CompilerStack::MetadataHash::IPFS;
|
||||
/// Chosen model checker engine.
|
||||
ModelCheckerEngine m_modelCheckerEngine = ModelCheckerEngine::All();
|
||||
/// Model checker settings.
|
||||
ModelCheckerSettings m_modelCheckerSettings;
|
||||
/// Whether or not to colorize diagnostics output.
|
||||
bool m_coloredOutput = true;
|
||||
/// Whether or not to output error IDs.
|
||||
|
||||
Reference in New Issue
Block a user