Browse Source

Properly outputing opcodes in solc, using normal stream operator

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
b95b6f3b66
  1. 5
      solc/CommandLineInterface.cpp

5
solc/CommandLineInterface.cpp

@ -122,19 +122,18 @@ void CommandLineInterface::handleBinary(string const& _contract)
void CommandLineInterface::handleOpcode(string const& _contract) void CommandLineInterface::handleOpcode(string const& _contract)
{ {
// TODO: Figure out why the wrong operator << (from boost) is used here
auto choice = m_args[ARG_OPCODES_STR].as<OutputType>(); auto choice = m_args[ARG_OPCODES_STR].as<OutputType>();
if (outputToStdout(choice)) if (outputToStdout(choice))
{ {
cout << "Opcodes: " << endl; cout << "Opcodes: " << endl;
dev::operator<<(cout, m_compiler.getBytecode(_contract)); cout << eth::disassemble(m_compiler.getBytecode(_contract));
cout << endl; cout << endl;
} }
if (outputToFile(choice)) if (outputToFile(choice))
{ {
ofstream outFile(_contract + ".opcode"); ofstream outFile(_contract + ".opcode");
dev::operator<<(outFile, m_compiler.getBytecode(_contract)); outFile << eth::disassemble(m_compiler.getBytecode(_contract));
outFile.close(); outFile.close();
} }
} }

Loading…
Cancel
Save