mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Pinhole optimise working fairly well...
This commit is contained in:
parent
36370900bb
commit
d48033009a
7
main.cpp
7
main.cpp
@ -55,6 +55,7 @@ enum Mode { Binary, Hex, Assembly, ParseTree };
|
|||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
unsigned optimise = 1;
|
||||||
string infile;
|
string infile;
|
||||||
Mode mode = Hex;
|
Mode mode = Hex;
|
||||||
|
|
||||||
@ -71,6 +72,8 @@ int main(int argc, char** argv)
|
|||||||
mode = Assembly;
|
mode = Assembly;
|
||||||
else if (arg == "-t" || arg == "--parse-tree")
|
else if (arg == "-t" || arg == "--parse-tree")
|
||||||
mode = ParseTree;
|
mode = ParseTree;
|
||||||
|
else if ((arg == "-o" || arg == "--optimise") && argc > i + 1)
|
||||||
|
optimise = atoi(argv[++i]);
|
||||||
else if (arg == "-V" || arg == "--version")
|
else if (arg == "-V" || arg == "--version")
|
||||||
version();
|
version();
|
||||||
else
|
else
|
||||||
@ -95,7 +98,7 @@ int main(int argc, char** argv)
|
|||||||
cerr << "Empty file." << endl;
|
cerr << "Empty file." << endl;
|
||||||
else if (mode == Binary || mode == Hex)
|
else if (mode == Binary || mode == Hex)
|
||||||
{
|
{
|
||||||
auto bs = compileLLL(src, &errors);
|
auto bs = compileLLL(src, optimise ? true : false, &errors);
|
||||||
if (mode == Hex)
|
if (mode == Hex)
|
||||||
cout << toHex(bs) << endl;
|
cout << toHex(bs) << endl;
|
||||||
else if (mode == Binary)
|
else if (mode == Binary)
|
||||||
@ -104,7 +107,7 @@ int main(int argc, char** argv)
|
|||||||
else if (mode == ParseTree)
|
else if (mode == ParseTree)
|
||||||
cout << parseLLL(src) << endl;
|
cout << parseLLL(src) << endl;
|
||||||
else if (mode == Assembly)
|
else if (mode == Assembly)
|
||||||
cout << compileLLLToAsm(src, &errors) << endl;
|
cout << compileLLLToAsm(src, optimise ? true : false, &errors) << endl;
|
||||||
for (auto const& i: errors)
|
for (auto const& i: errors)
|
||||||
cerr << i << endl;
|
cerr << i << endl;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user