Browse Source

1. Indenting spaces converted to tabs

2. Options changed: -G --> -g
cl-refactor
artur-zawlocki 10 years ago
parent
commit
6bf994de4d
  1. 21
      evmcc/evmcc.cpp

21
evmcc/evmcc.cpp

@ -1,4 +1,5 @@
#include <chrono>
#include <iostream>
#include <fstream>
#include <ostream>
@ -32,6 +33,7 @@ int main(int argc, char** argv)
bool opt_interpret = false;
bool opt_dump_graph = false;
bool opt_unknown = false;
bool opt_verbose = false;
size_t initialGas = 10000;
for (int i = 1; i < argc; i++)
@ -45,14 +47,16 @@ int main(int argc, char** argv)
opt_dissassemble = true;
else if (option == "-i")
opt_interpret = true;
else if (option == "-g")
else if (option == "--dump-cfg")
opt_dump_graph = true;
else if (option == "-G" && i + 1 < argc)
else if (option == "-g" && i + 1 < argc)
{
std::string gasValue = argv[++i];
initialGas = boost::lexical_cast<size_t>(gasValue);
std::cerr << "Initial gas set to " << initialGas << "\n";
}
else if (option == "-v")
opt_verbose = true;
else if (option[0] != '-' && input_file.empty())
input_file = option;
else
@ -87,9 +91,7 @@ int main(int argc, char** argv)
bytes bytecode = fromHex(src);
if (opt_show_bytes)
{
std::cout << memDump(bytecode) << std::endl;
}
if (opt_dissassemble)
{
@ -99,11 +101,22 @@ int main(int argc, char** argv)
if (opt_compile || opt_interpret)
{
auto compilationStartTime = std::chrono::high_resolution_clock::now();
auto compiler = eth::jit::Compiler();
auto module = compiler.compile({bytecode.data(), bytecode.size()});
auto compilationEndTime = std::chrono::high_resolution_clock::now();
module->dump();
if (opt_verbose)
{
std::cerr << "*** Compilation time: "
<< std::chrono::duration_cast<std::chrono::microseconds>(compilationEndTime - compilationStartTime).count()
<< std::endl;
}
if (opt_dump_graph)
{
std::ofstream ofs("blocks.dot");

Loading…
Cancel
Save