aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-03-17 20:29:57 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-04-21 02:38:00 +0800
commit13fa440d37582f80a144b3848340fceb5c55e88d (patch)
treec8795a917d29b1f63c1a2a4f0c64dadfb838d86b /libsolidity/interface
parent418759ece046798d9c1707bb9992aa43ba194303 (diff)
downloaddexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.tar
dexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.tar.gz
dexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.tar.bz2
dexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.tar.lz
dexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.tar.xz
dexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.tar.zst
dexon-solidity-13fa440d37582f80a144b3848340fceb5c55e88d.zip
Parse optimizer settings in StandardCompiler
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/StandardCompiler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index 7f3b7a58..88e3b111 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -43,9 +43,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
for (auto const& sourceName: sources.getMemberNames())
m_compilerStack.addSource(sourceName, sources[sourceName]["content"].asString());
- // @TODO parse settings
- bool optimize = false;
- unsigned optimizeRuns = 200;
+ Json::Value const& settings = _input.get("settings", Json::Value());
+
+ Json::Value optimizerSettings = settings.get("optimizer", Json::Value());
+ bool optimize = optimizerSettings.get("enabled", Json::Value(false)).asBool();
+ unsigned optimizeRuns = optimizerSettings.get("runs", Json::Value(200u)).asUInt();
+
map<string, h160> libraries;
auto scannerFromSourceName = [&](string const& _sourceName) -> solidity::Scanner const& { return m_compilerStack.scanner(_sourceName); };