diff options
author | chriseth <c@ethdev.com> | 2015-06-01 18:32:59 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-06-05 23:34:26 +0800 |
commit | a53859e3094a8740ebaf06eaf189a5755f273fb9 (patch) | |
tree | 1947c72103389bb43e20c83e88f8c86c3d211365 /CommandLineInterface.cpp | |
parent | 90c1203e566726b94c89820191cd0a6e89c91ec6 (diff) | |
download | dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.tar dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.tar.gz dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.tar.bz2 dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.tar.lz dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.tar.xz dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.tar.zst dexon-solidity-a53859e3094a8740ebaf06eaf189a5755f273fb9.zip |
Compute constants
Diffstat (limited to 'CommandLineInterface.cpp')
-rw-r--r-- | CommandLineInterface.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CommandLineInterface.cpp b/CommandLineInterface.cpp index 8129f60c..860b4c3b 100644 --- a/CommandLineInterface.cpp +++ b/CommandLineInterface.cpp @@ -299,7 +299,8 @@ bool CommandLineInterface::parseArguments(int argc, char** argv) desc.add_options() ("help", "Show help message and exit") ("version", "Show version and exit") - ("optimize", po::value<bool>()->default_value(false), "Optimize bytecode for size") + ("optimize", po::value<bool>()->default_value(false), "Optimize bytecode") + ("optimize-runs", po::value<unsigned>()->default_value(200), "Estimated number of contract runs for optimizer.") ("add-std", po::value<bool>()->default_value(false), "Add standard contracts") ("input-file", po::value<vector<string>>(), "input file") ( @@ -409,7 +410,11 @@ bool CommandLineInterface::processInput() for (auto const& sourceCode: m_sourceCodes) m_compiler->addSource(sourceCode.first, sourceCode.second); // TODO: Perhaps we should not compile unless requested - m_compiler->compile(m_args["optimize"].as<bool>()); + bool optimize = m_args["optimize"].as<bool>(); + unsigned runs = m_args["optimize-runs"].as<unsigned>(); + if (m_args.count("optimize-runs")) + optimize = true; + m_compiler->compile(optimize, runs); } catch (ParserError const& _exception) { |