aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-30 06:58:03 +0800
committerchriseth <chris@ethereum.org>2017-06-09 22:40:14 +0800
commitca92bda886740f7c59aaf44aaa8a15e25136c9dc (patch)
tree71d9da8928b660f2f8e89ac45d0c4c29ed177f01
parentf0d213e6b56da5be8088008bf2ceadb7fd0030f7 (diff)
downloaddexon-solidity-ca92bda886740f7c59aaf44aaa8a15e25136c9dc.tar.gz
dexon-solidity-ca92bda886740f7c59aaf44aaa8a15e25136c9dc.tar.zst
dexon-solidity-ca92bda886740f7c59aaf44aaa8a15e25136c9dc.zip
Supply text representation of assembly
-rw-r--r--libsolidity/interface/AssemblyStack.cpp4
-rw-r--r--solc/CommandLineInterface.cpp4
2 files changed, 7 insertions, 1 deletions
diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp
index 6a5e5494..7dc1edc7 100644
--- a/libsolidity/interface/AssemblyStack.cpp
+++ b/libsolidity/interface/AssemblyStack.cpp
@@ -91,7 +91,9 @@ MachineAssemblyObject AssemblyStack::assemble(Machine _machine) const
eth::Assembly assembly;
assembly::CodeGenerator::assemble(*m_parserResult, *m_analysisInfo, assembly);
object.bytecode = make_shared<eth::LinkerObject>(assembly.assemble());
- /// TODO: fill out text representation
+ ostringstream tmp;
+ assembly.stream(tmp);
+ object.assembly = tmp.str();
return object;
}
case Machine::EVM15:
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index e755c3b5..7509d1f2 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -1101,6 +1101,10 @@ bool CommandLineInterface::assemble(
cout << object.bytecode->toHex() << endl;
else
cerr << "No binary representation found." << endl;
+ if (!object.assembly.empty())
+ cout << object.assembly << endl;
+ else
+ cerr << "No text representation found." << endl;
cout << stack.print() << endl;
}