aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-11 05:51:10 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2014-11-11 05:51:10 +0800
commita44bd8c987aa4921db4ace42d4dd5357eb9e2ac2 (patch)
treec3095ab40b8ca70d861fedcf9d63353e9cb2f46b /main.cpp
parent8c384232eb6c729021a5bd89bd2eccea7c2af34c (diff)
downloaddexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar
dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.gz
dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.bz2
dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.lz
dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.xz
dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.zst
dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.zip
merge
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index 04fee290..04fdc0ee 100644
--- a/main.cpp
+++ b/main.cpp
@@ -42,7 +42,8 @@ void help()
{
cout << "Usage solc [OPTIONS] <file>" << endl
<< "Options:" << endl
- << " -h,--help Show this help message and exit." << endl
+ << " -o,--optimize Optimize the bytecode for size." << endl
+ << " -h,--help Show this help message and exit." << endl
<< " -V,--version Show the version and exit." << endl;
exit(0);
}
@@ -58,10 +59,13 @@ void version()
int main(int argc, char** argv)
{
string infile;
+ bool optimize = false;
for (int i = 1; i < argc; ++i)
{
string arg = argv[i];
- if (arg == "-h" || arg == "--help")
+ if (arg == "-o" || arg == "--optimize")
+ optimize = true;
+ else if (arg == "-h" || arg == "--help")
help();
else if (arg == "-V" || arg == "--version")
version();
@@ -98,7 +102,7 @@ int main(int argc, char** argv)
printer.print(cout);
compiler.compileContract(*ast);
- instructions = compiler.getAssembledBytecode();
+ instructions = compiler.getAssembledBytecode(optimize);
}
catch (ParserError const& exception)
{